Class XmlBeanSerializerModifier
- java.lang.Object
-
- com.fasterxml.jackson.databind.ser.BeanSerializerModifier
-
- com.fasterxml.jackson.dataformat.xml.ser.XmlBeanSerializerModifier
-
- All Implemented Interfaces:
java.io.Serializable
public class XmlBeanSerializerModifier extends BeanSerializerModifier implements java.io.Serializable
We need aBeanSerializerModifierto replace defaultBeanSerializerwith XML-specific one; mostly to ensure that attribute properties are output before element properties.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XmlBeanSerializerModifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<BeanPropertyWriter>changeProperties(SerializationConfig config, BeanDescription beanDesc, java.util.List<BeanPropertyWriter> beanProperties)First thing to do is to find annotations regarding XML serialization, and wrap collection serializers.JsonSerializer<?>modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer<?> serializer)Method called byBeanSerializerFactoryafter constructing default bean serializer instance with properties collected and ordered earlier.-
Methods inherited from class com.fasterxml.jackson.databind.ser.BeanSerializerModifier
modifyArraySerializer, modifyCollectionLikeSerializer, modifyCollectionSerializer, modifyEnumSerializer, modifyKeySerializer, modifyMapLikeSerializer, modifyMapSerializer, orderProperties, updateBuilder
-
-
-
-
Method Detail
-
changeProperties
public java.util.List<BeanPropertyWriter> changeProperties(SerializationConfig config, BeanDescription beanDesc, java.util.List<BeanPropertyWriter> beanProperties)
First thing to do is to find annotations regarding XML serialization, and wrap collection serializers.- Overrides:
changePropertiesin classBeanSerializerModifier
-
modifySerializer
public JsonSerializer<?> modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer<?> serializer)
Description copied from class:BeanSerializerModifierMethod called byBeanSerializerFactoryafter constructing default bean serializer instance with properties collected and ordered earlier. Implementations can modify or replace given serializer and return serializer to use. Note that although initial serializer being passed is of typeBeanSerializer, modifiers may return serializers of other types; and this is why implementations must check for type before casting.NOTE: since 2.2, gets called for serializer of those non-POJO types that do not go through any of more specific
modifyXxxSerializermethods; mostly for JDK types likeIteratorand such.- Overrides:
modifySerializerin classBeanSerializerModifier
-
-