Package com.fasterxml.jackson.databind
Class MappingJsonFactory
- java.lang.Object
-
- com.fasterxml.jackson.core.TokenStreamFactory
-
- com.fasterxml.jackson.core.JsonFactory
-
- com.fasterxml.jackson.databind.MappingJsonFactory
-
- All Implemented Interfaces:
Versioned,java.io.Serializable
public class MappingJsonFactory extends JsonFactory
Sub-class ofJsonFactorythat will create a properObjectCodecto allow seam-less conversions between JSON content and Java objects (POJOs). The only addition to regularJsonFactorycurrently is thatObjectMapperis constructed and passed as the codec to use.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonFactory
JsonFactory.Feature
-
-
Field Summary
-
Fields inherited from class com.fasterxml.jackson.core.JsonFactory
DEFAULT_QUOTE_CHAR, DEFAULT_ROOT_VALUE_SEPARATOR, FORMAT_NAME_JSON
-
-
Constructor Summary
Constructors Constructor Description MappingJsonFactory()MappingJsonFactory(JsonFactory src, ObjectMapper mapper)MappingJsonFactory(ObjectMapper mapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonFactorycopy()Method for constructing a newJsonFactorythat has the same settings as this instance, but is otherwise independent (i.e.ObjectMappergetCodec()We'll override the method to return more specific type; co-variance helps herejava.lang.StringgetFormatName()Sub-classes need to override this methodMatchStrengthhasFormat(InputAccessor acc)Sub-classes need to override this method-
Methods inherited from class com.fasterxml.jackson.core.JsonFactory
_getBufferRecycler, _getRecyclerPool, 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, createNonBlockingByteBufferParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, disable, disable, disable, enable, enable, enable, getCharacterEscapes, getFactoryFeatures, getFormatGeneratorFeatures, getFormatParserFeatures, getFormatReadFeatureType, getFormatWriteFeatureType, getGeneratorFeatures, getInputDecorator, getOutputDecorator, getParserFeatures, getRootValueSeparator, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, rebuild, requiresCustomCodec, requiresPropertyOrdering, setCharacterEscapes, setCodec, setErrorReportConfiguration, setInputDecorator, setOutputDecorator, setRecyclerPool, setRootValueSeparator, setStreamReadConstraints, setStreamWriteConstraints, streamReadConstraints, streamWriteConstraints, version
-
-
-
-
Constructor Detail
-
MappingJsonFactory
public MappingJsonFactory()
-
MappingJsonFactory
public MappingJsonFactory(ObjectMapper mapper)
-
MappingJsonFactory
public MappingJsonFactory(JsonFactory src, ObjectMapper mapper)
-
-
Method Detail
-
getCodec
public final ObjectMapper getCodec()
We'll override the method to return more specific type; co-variance helps here- Overrides:
getCodecin classJsonFactory
-
copy
public JsonFactory copy()
Description copied from class:JsonFactoryMethod for constructing a newJsonFactorythat has the same settings as this instance, but is otherwise independent (i.e. nothing is actually shared, symbol tables are separate). Note thatObjectCodecreference 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.- Overrides:
copyin classJsonFactory- Returns:
- Copy of this factory instance
-
getFormatName
public java.lang.String getFormatName()
Sub-classes need to override this method- Overrides:
getFormatNamein classJsonFactory- Returns:
- Name of the format handled by parsers, generators this factory creates
-
hasFormat
public MatchStrength hasFormat(InputAccessor acc) throws java.io.IOException
Sub-classes need to override this method- Overrides:
hasFormatin classJsonFactory- Throws:
java.io.IOException
-
-