|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasterxml.jackson.databind.deser.DataFormatReaders
public class DataFormatReaders
Alternative to DataFormatDetector
that needs to be used when
using data-binding.
Nested Class Summary | |
---|---|
protected class |
DataFormatReaders.AccessorForReader
We need sub-class here as well, to be able to access efficiently. |
static class |
DataFormatReaders.Match
Result class, similar to DataFormatMatcher |
Field Summary | |
---|---|
protected int |
_maxInputLookahead
Maximum number of leading bytes of the input that we can read to determine data format. |
protected MatchStrength |
_minimalMatch
Strength of minimal match we accept as the answer, unless better matches are found. |
protected MatchStrength |
_optimalMatch
Strength of match we consider to be good enough to be used without checking any other formats. |
protected 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. |
static 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. |
Constructor Summary | |
---|---|
DataFormatReaders(Collection<ObjectReader> detectors)
|
|
DataFormatReaders(ObjectReader... detectors)
|
Method Summary | |
---|---|
DataFormatReaders.Match |
findFormat(byte[] fullInputData)
Method to call to find format that given content (full document) has, as per configuration of this detector instance. |
DataFormatReaders.Match |
findFormat(byte[] fullInputData,
int offset,
int len)
Method to call to find format that given content (full document) has, as per configuration of this detector instance. |
DataFormatReaders.Match |
findFormat(InputStream in)
Method to call to find format that content (accessible via given InputStream ) given has, as per configuration of this detector
instance. |
String |
toString()
|
DataFormatReaders |
with(DeserializationConfig config)
|
DataFormatReaders |
with(ObjectReader[] readers)
|
DataFormatReaders |
withMaxInputLookahead(int lookaheadBytes)
|
DataFormatReaders |
withMinimalMatch(MatchStrength minMatch)
|
DataFormatReaders |
withOptimalMatch(MatchStrength optMatch)
|
DataFormatReaders |
withType(JavaType type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MAX_INPUT_LOOKAHEAD
protected final ObjectReader[] _readers
protected final MatchStrength _optimalMatch
MatchStrength.SOLID_MATCH
,
protected final MatchStrength _minimalMatch
MatchStrength.WEAK_MATCH
,
protected final int _maxInputLookahead
Default value is DEFAULT_MAX_INPUT_LOOKAHEAD
.
Constructor Detail |
---|
public DataFormatReaders(ObjectReader... detectors)
public DataFormatReaders(Collection<ObjectReader> detectors)
Method Detail |
---|
public DataFormatReaders withOptimalMatch(MatchStrength optMatch)
public DataFormatReaders withMinimalMatch(MatchStrength minMatch)
public DataFormatReaders with(ObjectReader[] readers)
public DataFormatReaders withMaxInputLookahead(int lookaheadBytes)
public DataFormatReaders with(DeserializationConfig config)
public DataFormatReaders withType(JavaType type)
public DataFormatReaders.Match findFormat(InputStream in) throws IOException
InputStream
) given has, as per configuration of this detector
instance.
IOException
public DataFormatReaders.Match findFormat(byte[] fullInputData) throws IOException
IOException
public DataFormatReaders.Match findFormat(byte[] fullInputData, int offset, int len) throws IOException
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |