public class MappingJsonFactory extends JsonFactory
JsonFactory that will create a proper
ObjectCodec to allow seam-less conversions between
JSON content and Java objects (POJOs).
The only addition to regular JsonFactory currently
is that ObjectMapper is constructed and passed as
the codec to use.JsonFactory.FeatureDEFAULT_QUOTE_CHAR, DEFAULT_ROOT_VALUE_SEPARATOR, FORMAT_NAME_JSON| Constructor and Description |
|---|
MappingJsonFactory() |
MappingJsonFactory(JsonFactory src,
ObjectMapper mapper) |
MappingJsonFactory(ObjectMapper mapper) |
| Modifier and Type | Method and Description |
|---|---|
JsonFactory |
copy()
Method for constructing a new
JsonFactory that has
the same settings as this instance, but is otherwise
independent (i.e. |
ObjectMapper |
getCodec()
We'll override the method to return more specific type; co-variance
helps here
|
java.lang.String |
getFormatName()
Sub-classes need to override this method
|
MatchStrength |
hasFormat(InputAccessor acc)
Sub-classes need to override this method
|
_getBufferRecycler, builder, canHandleBinaryNatively, canParseAsync, canUseCharArrays, canUseSchema, configure, configure, configure, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createJsonGenerator, createJsonGenerator, createJsonGenerator, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createNonBlockingByteArrayParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, disable, disable, disable, enable, enable, enable, getCharacterEscapes, getFormatGeneratorFeatures, getFormatParserFeatures, getFormatReadFeatureType, getFormatWriteFeatureType, getGeneratorFeatures, getInputDecorator, getOutputDecorator, getParserFeatures, getRootValueSeparator, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, rebuild, requiresCustomCodec, requiresPropertyOrdering, setCharacterEscapes, setCodec, setInputDecorator, setOutputDecorator, setRootValueSeparator, versionpublic MappingJsonFactory()
public MappingJsonFactory(ObjectMapper mapper)
public MappingJsonFactory(JsonFactory src, ObjectMapper mapper)
public final ObjectMapper getCodec()
getCodec in class JsonFactorypublic JsonFactory copy()
JsonFactoryJsonFactory that has
the same settings as this instance, but is otherwise
independent (i.e. nothing is actually shared, symbol tables
are separate).
Note that ObjectCodec reference is not copied but is
set to null; caller typically needs to set it after calling
this method. Reason for this is that the codec is used for
callbacks, and assumption is that there is strict 1-to-1
mapping between codec, factory. Caller has to, then, explicitly
set codec after making the copy.copy in class JsonFactorypublic java.lang.String getFormatName()
getFormatName in class JsonFactorypublic MatchStrength hasFormat(InputAccessor acc) throws java.io.IOException
hasFormat in class JsonFactoryjava.io.IOExceptionCopyright © 2010 - 2023 Adobe. All Rights Reserved