Class XmlSerializerProvider
java.lang.Object
com.fasterxml.jackson.databind.DatabindContext
com.fasterxml.jackson.databind.SerializerProvider
com.fasterxml.jackson.databind.ser.DefaultSerializerProvider
com.fasterxml.jackson.dataformat.xml.ser.XmlSerializerProvider
- All Implemented Interfaces:
Serializable
We need to override some parts of
SerializerProvider
implementation to handle oddities of XML output, like "extra" root element.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.ser.DefaultSerializerProvider
DefaultSerializerProvider.Impl -
Field Summary
Fields inherited from class com.fasterxml.jackson.databind.SerializerProvider
DEFAULT_NULL_KEY_SERIALIZER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Method needed to ensure thatObjectMapper.copy()will work properly; specifically, that caches are cleared, but settings will otherwise remain identical; and that no sharing of state occurs.createInstance(SerializationConfig config, SerializerFactory jsf) Method that sub-classes need to implement: used to create a non-blueprint instances from the blueprint.voidserializePolymorphic(JsonGenerator gen, Object value, JavaType rootType, JsonSerializer<Object> valueSer, TypeSerializer typeSer) Alternate serialization call used for polymorphic types, whenTypeSerializeris already known, but the actual serializer may or may not be.voidserializeValue(JsonGenerator gen, Object value) The method to be called byObjectMapperandObjectWriterfor serializing given value, using serializers that this provider has access to (via caching and/or creating new serializers as need be).voidserializeValue(JsonGenerator gen, Object value, JavaType rootType) The method to be called byObjectMapperandObjectWriterfor serializing given value (assumed to be of specified root type, instead of runtime type of value), using serializers that this provider has access to (via caching and/or creating new serializers as need be),voidserializeValue(JsonGenerator gen, Object value, JavaType rootType, JsonSerializer<Object> ser) The method to be called byObjectWriterfor serializing given value (assumed to be of specified root type, instead of runtime type of value), when it may know specificJsonSerializerto use.withCaches(CacheProvider cacheProvider) Fluent factory method used for constructing a new instance with cache instances provided byCacheProvider.Methods inherited from class com.fasterxml.jackson.databind.ser.DefaultSerializerProvider
acceptJsonFormatVisitor, cachedSerializersCount, findObjectId, flushCachedSerializers, generateJsonSchema, getGenerator, hasSerializerFor, includeFilterInstance, includeFilterSuppressNulls, serializerInstanceMethods inherited from class com.fasterxml.jackson.databind.SerializerProvider
bufferForValueConversion, bufferForValueConversion, canOverrideAccessModifiers, constructSpecializedType, defaultSerializeDateKey, defaultSerializeDateKey, defaultSerializeDateValue, defaultSerializeDateValue, defaultSerializeField, defaultSerializeNull, defaultSerializeValue, findContentValueSerializer, findContentValueSerializer, findKeySerializer, findKeySerializer, findNullKeySerializer, findNullValueSerializer, findPrimaryPropertySerializer, findPrimaryPropertySerializer, findTypedValueSerializer, findTypedValueSerializer, findTypeSerializer, findValueSerializer, findValueSerializer, findValueSerializer, findValueSerializer, getActiveView, getAnnotationIntrospector, getAttribute, getConfig, getDatatypeFeatures, getDefaultNullKeySerializer, getDefaultNullValueSerializer, getDefaultPropertyFormat, getDefaultPropertyInclusion, getFilterProvider, getLocale, getTimeZone, getTypeFactory, getUnknownTypeSerializer, handlePrimaryContextualization, handleSecondaryContextualization, hasSerializationFeatures, invalidTypeIdException, isEnabled, isEnabled, isEnabled, isUnknownTypeSerializer, mappingException, reportBadDefinition, reportBadDefinition, reportBadDefinition, reportBadPropertyDefinition, reportBadTypeDefinition, reportMappingProblem, reportMappingProblem, setAttribute, setDefaultKeySerializer, setNullKeySerializer, setNullValueSerializerMethods inherited from class com.fasterxml.jackson.databind.DatabindContext
constructType, converterInstance, objectIdGeneratorInstance, objectIdResolverInstance, reportBadDefinition, resolveAndValidateSubType, resolveSubType
-
Constructor Details
-
XmlSerializerProvider
-
XmlSerializerProvider
public XmlSerializerProvider(XmlSerializerProvider src, SerializationConfig config, SerializerFactory f)
-
-
Method Details
-
copy
Description copied from class:DefaultSerializerProviderMethod needed to ensure thatObjectMapper.copy()will work properly; specifically, that caches are cleared, but settings will otherwise remain identical; and that no sharing of state occurs.- Overrides:
copyin classDefaultSerializerProvider
-
withCaches
Description copied from class:DefaultSerializerProviderFluent factory method used for constructing a new instance with cache instances provided byCacheProvider.- Specified by:
withCachesin classDefaultSerializerProvider
-
createInstance
Description copied from class:DefaultSerializerProviderMethod that sub-classes need to implement: used to create a non-blueprint instances from the blueprint. This is needed to retain state during serialization.- Specified by:
createInstancein classDefaultSerializerProvider
-
serializeValue
Description copied from class:DefaultSerializerProviderThe method to be called byObjectMapperandObjectWriterfor serializing given value, using serializers that this provider has access to (via caching and/or creating new serializers as need be).- Overrides:
serializeValuein classDefaultSerializerProvider- Throws:
IOException
-
serializeValue
Description copied from class:DefaultSerializerProviderThe method to be called byObjectMapperandObjectWriterfor serializing given value (assumed to be of specified root type, instead of runtime type of value), using serializers that this provider has access to (via caching and/or creating new serializers as need be),- Overrides:
serializeValuein classDefaultSerializerProvider- Parameters:
rootType- Type to use for locating serializer to use, instead of actual runtime type. Must be actual type, or one of its super types- Throws:
IOException
-
serializeValue
public void serializeValue(JsonGenerator gen, Object value, JavaType rootType, JsonSerializer<Object> ser) throws IOException Description copied from class:DefaultSerializerProviderThe method to be called byObjectWriterfor serializing given value (assumed to be of specified root type, instead of runtime type of value), when it may know specificJsonSerializerto use.- Overrides:
serializeValuein classDefaultSerializerProvider- Parameters:
rootType- Type to use for locating serializer to use, instead of actual runtime type, if no serializer is passedser- Root Serializer to use, if not null- Throws:
IOException
-
serializePolymorphic
public void serializePolymorphic(JsonGenerator gen, Object value, JavaType rootType, JsonSerializer<Object> valueSer, TypeSerializer typeSer) throws IOException Description copied from class:DefaultSerializerProviderAlternate serialization call used for polymorphic types, whenTypeSerializeris already known, but the actual serializer may or may not be.- Overrides:
serializePolymorphicin classDefaultSerializerProvider- Throws:
IOException
-