java.lang.Object | |
↳ | com.fasterxml.jackson.core.format.DataFormatDetector |
Simple helper class that allows data format (content type) auto-detection,
given an ordered set of JsonFactory
instances to use for actual low-level
detection.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_MAX_INPUT_LOOKAHEAD | By default we will look ahead at most 64 bytes; in most cases, much less (4 bytes or so) is needed, but we will allow bit more leniency to support data formats that need more complex heuristics. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
_detectors | Ordered list of factories which both represent data formats to detect (in precedence order, starting with highest) and are used for actual detection. | ||||||||||
_maxInputLookahead | Maximum number of leading bytes of the input that we can read to determine data format. | ||||||||||
_minimalMatch | Strength of minimal match we accept as the answer, unless better matches are found. | ||||||||||
_optimalMatch | Strength of match we consider to be good enough to be used without checking any other formats. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Method to call to find format that content (accessible via given
InputStream ) given has, as per configuration of this detector
instance. | |||||||||||
Method to call to find format that given content (full document)
has, as per configuration of this detector instance.
| |||||||||||
Method that will return a detector instance that allows detectors to
read up to specified number of bytes when determining format match strength.
| |||||||||||
Method that will return a detector instance that uses given
minimal match level; match that may be returned unless a stronger match
is found with other format detectors.
| |||||||||||
Method that will return a detector instance that uses given
optimal match level (match that is considered sufficient to return, without
trying to find stronger matches with other formats).
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
By default we will look ahead at most 64 bytes; in most cases, much less (4 bytes or so) is needed, but we will allow bit more leniency to support data formats that need more complex heuristics.
Ordered list of factories which both represent data formats to detect (in precedence order, starting with highest) and are used for actual detection.
Maximum number of leading bytes of the input that we can read to determine data format.
Default value is DEFAULT_MAX_INPUT_LOOKAHEAD
.
Strength of minimal match we accept as the answer, unless
better matches are found.
Default value is WEAK_MATCH
,
Strength of match we consider to be good enough to be used
without checking any other formats.
Default value is SOLID_MATCH
,
Method to call to find format that content (accessible via given
InputStream
) given has, as per configuration of this detector
instance.
IOException |
---|
Method to call to find format that given content (full document) has, as per configuration of this detector instance.
IOException |
---|
Method that will return a detector instance that allows detectors to read up to specified number of bytes when determining format match strength.
Method that will return a detector instance that uses given minimal match level; match that may be returned unless a stronger match is found with other format detectors.
Method that will return a detector instance that uses given optimal match level (match that is considered sufficient to return, without trying to find stronger matches with other formats).