Top Description Fields Constructors Methods
com.fasterxml.jackson.core.format

public Class DataFormatMatcher

extends Object
Class Inheritance
Imports
java.io.*, com.fasterxml.jackson.core.JsonFactory, .JsonParser, com.fasterxml.jackson.core.io.MergedStream

Result object constructed by DataFormatDetector when requested to detect format of given input data.

Field Summary

Modifier and TypeField 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 JsonFactory
_match

Factory that produced sufficient match (if any)

protected final MatchStrength
_matchStrength

Strength of match with _match

protected final InputStream

Constructor Summary

AccessConstructor and Description
protected
DataFormatMatcher(InputStream in, byte[] buffered, int bufferedStart, int bufferedLength, JsonFactory match, MatchStrength strength)

Method Summary

Modifier and TypeMethod and Description
public JsonParser
public InputStream

Returns:

InputStream to use for reading actual content using format detected
getDataStream
()

Method to use for accessing input for which format detection has been done.

public JsonFactory

Returns:

Relevant JsonFactory to indicate matched format
getMatch
()

Accessor for JsonFactory that represents format that data matched.

public String

Returns:

Name of the format that is acceptable match, if any; null if none
getMatchedFormatName
()

Accessor for getting brief textual name of matched format if any (null if none).

public MatchStrength

Returns:

Strength of match
getMatchStrength
()

Method for accessing strength of the match, if any; if no match, will return MatchStrength#INCONCLUSIVE.

public boolean

Returns:

Whether format has a match
hasMatch
()

Accessor to use to see if any formats matched well enough with the input data.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_bufferedDataback to summary
protected final byte[] _bufferedData

Content read during format matching process

_bufferedLengthback to summary
protected final int _bufferedLength

Number of bytes available in buffer.

_bufferedStartback to summary
protected final int _bufferedStart

Pointer to the first byte in buffer available for reading

_matchback to summary
protected final JsonFactory _match

Factory that produced sufficient match (if any)

_matchStrengthback to summary
protected final MatchStrength _matchStrength

Strength of match with _match

_originalStreamback to summary
protected final InputStream _originalStream

Constructor Detail

DataFormatMatcherback to summary
protected DataFormatMatcher(InputStream in, byte[] buffered, int bufferedStart, int bufferedLength, JsonFactory match, MatchStrength strength)

Method Detail

createParserWithMatchback to summary
public JsonParser createParserWithMatch() throws IOException
getDataStreamback 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.

Returns:InputStream

InputStream to use for reading actual content using format detected

getMatchback to summary
public JsonFactory getMatch()

Accessor for JsonFactory that represents format that data matched.

Returns:JsonFactory

Relevant JsonFactory to indicate matched format

getMatchedFormatNameback 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;
Returns:String

Name of the format that is acceptable match, if any; null if none

getMatchStrengthback to summary
public MatchStrength getMatchStrength()

Method for accessing strength of the match, if any; if no match, will return MatchStrength#INCONCLUSIVE.

Returns:MatchStrength

Strength of match

hasMatchback to summary
public boolean hasMatch()

Accessor to use to see if any formats matched well enough with the input data.

Returns:boolean

Whether format has a match