DataFormatDetector that needs to be used when
using data-binding.
| Modifier and Type | Class and Description |
|---|---|
| protected static class | DataFormatReaders.AccessorForReader
We need sub-class here as well, to be able to access efficiently. |
| public static class | DataFormatReaders.Match
Result class, similar to |
| Modifier and Type | Field and Description |
|---|---|
| protected final int | _maxInputLookahead
Maximum number of leading bytes of the input that we can read to determine data format. |
| protected final MatchStrength | _minimalMatch
Strength of minimal match we accept as the answer, unless better matches are found. |
| protected final MatchStrength | _optimalMatch
Strength of match we consider to be good enough to be used without checking any other formats. |
| protected final ObjectReader[] | _readers
Ordered list of readers which both represent data formats to detect (in precedence order, starting with highest) and contain factories used for actual detection. |
| public static final 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. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| private | DataFormatReaders(ObjectReader[] detectors, MatchStrength optMatch, MatchStrength minMatch, int maxInputLookahead)
|
| Modifier and Type | Method and Description |
|---|---|
| private DataFormatReaders. | |
| public DataFormatReaders. | Returns: Matcher object which contains result; never null, even in cases where no match (with specified minimal match strength) is found.Method to call to find format that content (accessible via given
|
| public DataFormatReaders. | Returns: Matcher object which contains result; never null, even in cases where no match (with specified minimal match strength) is found.Method to call to find format that given content (full document) has, as per configuration of this detector instance. |
| public DataFormatReaders. | Returns: Matcher object which contains result; never null, even in cases where no match (with specified minimal match strength) is found.Method to call to find format that given content (full document) has, as per configuration of this detector instance. |
| public String | |
| public DataFormatReaders | |
| public DataFormatReaders | |
| public DataFormatReaders | |
| public DataFormatReaders | |
| public DataFormatReaders | |
| public DataFormatReaders |
| _maxInputLookahead | back to summary |
|---|---|
| protected final int _maxInputLookahead Maximum number of leading bytes of the input that we can read to determine data format.
Default value is | |
| _minimalMatch | back to summary |
|---|---|
| protected final MatchStrength _minimalMatch Strength of minimal match we accept as the answer, unless
better matches are found.
Default value is | |
| _optimalMatch | back to summary |
|---|---|
| protected final MatchStrength _optimalMatch Strength of match we consider to be good enough to be used
without checking any other formats.
Default value is | |
| _readers | back to summary |
|---|---|
| protected final ObjectReader[] _readers Ordered list of readers which both represent data formats to detect (in precedence order, starting with highest) and contain factories used for actual detection. | |
| DEFAULT_MAX_INPUT_LOOKAHEAD | back to summary |
|---|---|
| public static final 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. | |
| DataFormatReaders | back to summary |
|---|---|
| public DataFormatReaders(ObjectReader... detectors) | |
| DataFormatReaders | back to summary |
|---|---|
| public DataFormatReaders(Collection<ObjectReader> detectors) | |
| DataFormatReaders | back to summary |
|---|---|
| private DataFormatReaders(ObjectReader[] detectors, MatchStrength optMatch, MatchStrength minMatch, int maxInputLookahead) | |
| _findFormat | back to summary |
|---|---|
| private DataFormatReaders. | |
| findFormat | back to summary |
|---|---|
| public DataFormatReaders. Method to call to find format that content (accessible via given
| |
| findFormat | back to summary |
|---|---|
| public DataFormatReaders. Method to call to find format that given content (full document) has, as per configuration of this detector instance.
| |
| findFormat | back to summary |
|---|---|
| public DataFormatReaders. Method to call to find format that given content (full document) has, as per configuration of this detector instance.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| with | back to summary |
|---|---|
| public DataFormatReaders with(ObjectReader[] readers) | |
| with | back to summary |
|---|---|
| public DataFormatReaders with(DeserializationConfig config) | |
| withMaxInputLookahead | back to summary |
|---|---|
| public DataFormatReaders withMaxInputLookahead(int lookaheadBytes) | |
| withMinimalMatch | back to summary |
|---|---|
| public DataFormatReaders withMinimalMatch(MatchStrength minMatch) | |
| withOptimalMatch | back to summary |
|---|---|
| public DataFormatReaders withOptimalMatch(MatchStrength optMatch) | |
| withType | back to summary |
|---|---|
| public DataFormatReaders withType(JavaType type) | |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public DataFormatReaders. |
| AccessorForReader | back to summary |
|---|---|
| public AccessorForReader(InputStream in, byte[] buffer) | |
| AccessorForReader | back to summary |
|---|---|
| public AccessorForReader(byte[] inputDocument) | |
| AccessorForReader | back to summary |
|---|---|
| public AccessorForReader(byte[] inputDocument, int start, int len) | |
| createMatcher | back to summary |
|---|---|
| public DataFormatReaders. | |
DataFormatMatcher
| Modifier and Type | Field and Description |
|---|---|
| protected final byte[] | _bufferedData
Content read during format matching process |
| protected final int | _bufferedLength
Number of bytes available in buffer. |
| protected final int | _bufferedStart
Pointer to the first byte in buffer available for reading |
| protected final ObjectReader | _match
Factory that produced sufficient match (if any) |
| protected final MatchStrength | _matchStrength
Strength of match with |
| protected final InputStream |
| Access | Constructor and Description |
|---|---|
| protected | Match(InputStream in, byte[] buffered, int bufferedStart, int bufferedLength, ObjectReader match, MatchStrength strength)
|
| Modifier and Type | Method and Description |
|---|---|
| public JsonParser | createParserWithMatch()
Convenience method for trying to construct a |
| public InputStream | |
| public String | getMatchedFormatName()
Accessor for getting brief textual name of matched format if any (null if none). |
| public MatchStrength | getMatchStrength()
Method for accessing strength of the match, if any; if no match,
will return |
| public ObjectReader | |
| public boolean |
| _bufferedData | back to summary |
|---|---|
| protected final byte[] _bufferedData Content read during format matching process | |
| _bufferedLength | back to summary |
|---|---|
| protected final int _bufferedLength Number of bytes available in buffer. | |
| _bufferedStart | back to summary |
|---|---|
| protected final int _bufferedStart Pointer to the first byte in buffer available for reading | |
| _match | back to summary |
|---|---|
| protected final ObjectReader _match Factory that produced sufficient match (if any) | |
| _matchStrength | back to summary |
|---|---|
| protected final MatchStrength _matchStrength Strength of match with | |
| _originalStream | back to summary |
|---|---|
| protected final InputStream _originalStream | |
| Match | back to summary |
|---|---|
| protected Match(InputStream in, byte[] buffered, int bufferedStart, int bufferedLength, ObjectReader match, MatchStrength strength) | |
| createParserWithMatch | back to summary |
|---|---|
| public JsonParser createParserWithMatch() throws IOException Convenience method for trying to construct a | |
| getDataStream | back to summary |
|---|---|
| public InputStream getDataStream() Method to use for accessing input for which format detection has been done. This must be used instead of using stream passed to detector unless given stream itself can do buffering. Stream will return all content that was read during matching process, as well as remaining contents of the underlying stream. | |
| getMatchedFormatName | back to summary |
|---|---|
| public String getMatchedFormatName() Accessor for getting brief textual name of matched format if any (null if none). Equivalent to: return hasMatch() ? getMatch().getFormatName() : null; | |
| getMatchStrength | back to summary |
|---|---|
| public MatchStrength getMatchStrength() Method for accessing strength of the match, if any; if no match,
will return | |
| getReader | back to summary |
|---|---|
| public ObjectReader getReader() Accessor for | |
| hasMatch | back to summary |
|---|---|
| public boolean hasMatch() Accessor to use to see if any formats matched well enough with the input data. | |