canParse abstract method

bool canParse(
  1. String content
)

Tests if the provided content is likely in this codec's format

This method is used for codec auto-detection when no explicit MIME type is available. It should perform quick heuristic checks to determine if the content appears to be in the format supported by this codec.

The method should balance accuracy with performance - it should not perform a full parse, but should do enough checking to make a reasonable determination.

The content parameter is the string content to check.

Returns true if the content appears to be in this codec's format.

Implementation

bool canParse(String content);