Class DataFormatMatcher
- java.lang.Object
-
- com.fasterxml.jackson.core.format.DataFormatMatcher
-
public class DataFormatMatcher extends java.lang.ObjectResult object constructed byDataFormatDetectorwhen requested to detect format of given input data.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonParsercreateParserWithMatch()Convenience method for trying to construct aJsonParserfor parsing content which is assumed to be in detected data format.java.io.InputStreamgetDataStream()Method to use for accessing input for which format detection has been done.JsonFactorygetMatch()Accessor forJsonFactorythat represents format that data matched.java.lang.StringgetMatchedFormatName()Accessor for getting brief textual name of matched format if any (null if none).MatchStrengthgetMatchStrength()Method for accessing strength of the match, if any; if no match, will returnMatchStrength.INCONCLUSIVE.booleanhasMatch()Accessor to use to see if any formats matched well enough with the input data.
-
-
-
Method Detail
-
hasMatch
public boolean hasMatch()
Accessor to use to see if any formats matched well enough with the input data.
-
getMatchStrength
public MatchStrength getMatchStrength()
Method for accessing strength of the match, if any; if no match, will returnMatchStrength.INCONCLUSIVE.
-
getMatch
public JsonFactory getMatch()
Accessor forJsonFactorythat represents format that data matched.
-
getMatchedFormatName
public java.lang.String getMatchedFormatName()
Accessor for getting brief textual name of matched format if any (null if none). Equivalent to:return hasMatch() ? getMatch().getFormatName() : null;
-
createParserWithMatch
public JsonParser createParserWithMatch() throws java.io.IOException
Convenience method for trying to construct aJsonParserfor parsing content which is assumed to be in detected data format. If no match was found, returns null.- Throws:
java.io.IOException
-
getDataStream
public java.io.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.
-
-