BeanSerializerBase needed to take care
of some xml-specific aspects, such as distinction between attributes
and elements.
| Modifier and Type | Field and Description |
|---|---|
| protected final int | _attributeCount
Number of attributes to write; these will have been ordered to be the first properties to write. |
| protected final BitSet | _cdata
Optional set of indexes of properties that should be serialized as CDATA, instead of regular XML text segment. |
| protected final int | _textPropertyIndex
Index of "text value" property we have, if any; can have at most one such property. |
| protected final QName[] | _xmlNames
Array that contains namespace URIs associated with properties, if any; null if no namespace definitions have been assigned |
| public static final String | KEY_XML_INFO
Marker used for storing associated internal data with |
| Access | Constructor and Description |
|---|---|
| public | |
| protected | |
| protected | |
| protected | |
| public | |
| protected | XmlBeanSerializerBase(XmlBeanSerializerBase src, BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties)
|
| Modifier and Type | Method and Description |
|---|---|
| protected static boolean | |
| protected static boolean | |
| protected static int | _orderAttributesFirst(BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties)
Method for re-sorting lists of bean properties such that attributes are strictly written before elements. |
| protected void | _serializeObjectId(Object bean, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer, WritableObjectId objectId)
Overrides tools.
|
| protected void | _serializeProperties(Object bean, JsonGenerator gen0, SerializationContext ctxt)
Overrides tools. Main serialization method needs to be overridden to allow XML-specific extra handling, such as indication of whether to write attributes or elements. |
| protected void | _serializePropertiesFiltered(Object bean, JsonGenerator gen0, SerializationContext ctxt, Object filterId)
Overrides tools. Alternative serialization method that gets called when there is a
|
| public void | serializeWithType(Object bean, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer)
Overrides tools. Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information. |
| _attributeCount | back to summary |
|---|---|
| protected final int _attributeCount Number of attributes to write; these will have been ordered to be the first properties to write. | |
| _cdata | back to summary |
|---|---|
| protected final BitSet _cdata Optional set of indexes of properties that should be serialized as CDATA, instead of regular XML text segment. Left as null in cases where none of element values are to be written in such a way. | |
| _textPropertyIndex | back to summary |
|---|---|
| protected final int _textPropertyIndex Index of "text value" property we have, if any; can have at most one such property. | |
| _xmlNames | back to summary |
|---|---|
| protected final QName[] _xmlNames Array that contains namespace URIs associated with properties, if any; null if no namespace definitions have been assigned | |
| KEY_XML_INFO | back to summary |
|---|---|
| public static final String KEY_XML_INFO Marker used for storing associated internal data with | |
| XmlBeanSerializerBase | back to summary |
|---|---|
| public XmlBeanSerializerBase(BeanSerializerBase src) | |
| XmlBeanSerializerBase | back to summary |
|---|---|
| protected XmlBeanSerializerBase(XmlBeanSerializerBase src, ObjectIdWriter objectIdWriter) | |
| XmlBeanSerializerBase | back to summary |
|---|---|
| protected XmlBeanSerializerBase(XmlBeanSerializerBase src, ObjectIdWriter objectIdWriter, Object filterId) | |
| XmlBeanSerializerBase | back to summary |
|---|---|
| protected XmlBeanSerializerBase(XmlBeanSerializerBase src, Set<String> toIgnore, Set<String> toInclude) | |
| XmlBeanSerializerBase | back to summary |
|---|---|
| public XmlBeanSerializerBase(XmlBeanSerializerBase src, NameTransformer transformer) | |
| XmlBeanSerializerBase | back to summary |
|---|---|
| protected XmlBeanSerializerBase(XmlBeanSerializerBase src, BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties) | |
| _isAttribute | back to summary |
|---|---|
| protected static boolean _isAttribute(BeanPropertyWriter bpw) | |
| _isCData | back to summary |
|---|---|
| protected static boolean _isCData(BeanPropertyWriter bpw) | |
| _orderAttributesFirst | back to summary |
|---|---|
| protected static int _orderAttributesFirst(BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties) Method for re-sorting lists of bean properties such that attributes are strictly written before elements. | |
| _serializeObjectId | back to summary |
|---|---|
| protected void _serializeObjectId(Object bean, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer, WritableObjectId objectId) throws JacksonException Overrides tools.
| |
| _serializeProperties | back to summary |
|---|---|
| protected void _serializeProperties(Object bean, JsonGenerator gen0, SerializationContext ctxt) throws JacksonException Overrides tools. Main serialization method needs to be overridden to allow XML-specific extra handling, such as indication of whether to write attributes or elements.
| |
| _serializePropertiesFiltered | back to summary |
|---|---|
| protected void _serializePropertiesFiltered(Object bean, JsonGenerator gen0, SerializationContext ctxt, Object filterId) throws JacksonException Overrides tools. Doc from tools. Alternative serialization method that gets called when there is a
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(Object bean, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException Overrides tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information.
Default implementation will throw For simple datatypes written as a single scalar value (JSON String, Number, Boolean), implementation would look like: // note: method to call depends on whether this type is serialized as JSON scalar, object or Array! typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, provider); typeSer.writeTypeSuffixForScalar(value, gen);and implementations for type serialized as JSON Arrays or Objects would differ slightly, as START-ARRAY/END-ARRAY and
START-OBJECT/END-OBJECT pairs
need to be properly handled with respect to serializing of contents.
| |