public abstract class XmlBeanSerializerBase
extends com.fasterxml.jackson.databind.ser.std.BeanSerializerBase
BeanSerializerBase
needed to take care
of some xml-specific aspects, such as distinction between attributes
and elements.Modifier and Type | Field and Description |
---|---|
protected int |
_attributeCount
Number of attributes to write; these will have been ordered to be the first
properties to write.
|
protected BitSet |
_cdata
Optional set of indexes of properties that should be serialized as CDATA,
instead of regular XML text segment.
|
protected int |
_textPropertyIndex
Index of "text value" property we have, if any; can have at most
one such property.
|
protected QName[] |
_xmlNames
Array that contains namespace URIs associated with properties, if any;
null if no namespace definitions have been assigned
|
static String |
KEY_XML_INFO
Marker used for storing associated internal data with
BeanPropertyWriter
instances; to mark instances that are to be written out as attributes. |
Modifier | Constructor and Description |
---|---|
|
XmlBeanSerializerBase(com.fasterxml.jackson.databind.ser.std.BeanSerializerBase src) |
protected |
XmlBeanSerializerBase(XmlBeanSerializerBase src,
com.fasterxml.jackson.databind.ser.BeanPropertyWriter[] properties,
com.fasterxml.jackson.databind.ser.BeanPropertyWriter[] filteredProperties) |
|
XmlBeanSerializerBase(XmlBeanSerializerBase src,
com.fasterxml.jackson.databind.util.NameTransformer transformer) |
protected |
XmlBeanSerializerBase(XmlBeanSerializerBase src,
com.fasterxml.jackson.databind.ser.impl.ObjectIdWriter objectIdWriter) |
protected |
XmlBeanSerializerBase(XmlBeanSerializerBase src,
com.fasterxml.jackson.databind.ser.impl.ObjectIdWriter objectIdWriter,
Object filterId) |
protected |
XmlBeanSerializerBase(XmlBeanSerializerBase src,
Set<String> toIgnore,
Set<String> toInclude) |
Modifier and Type | Method and Description |
---|---|
protected static boolean |
_isAttribute(com.fasterxml.jackson.databind.ser.BeanPropertyWriter bpw) |
protected static boolean |
_isCData(com.fasterxml.jackson.databind.ser.BeanPropertyWriter bpw) |
protected static int |
_orderAttributesFirst(com.fasterxml.jackson.databind.ser.BeanPropertyWriter[] properties,
com.fasterxml.jackson.databind.ser.BeanPropertyWriter[] filteredProperties)
Method for re-sorting lists of bean properties such that attributes are strictly
written before elements.
|
protected void |
_serializeObjectId(Object bean,
com.fasterxml.jackson.core.JsonGenerator gen,
com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer,
com.fasterxml.jackson.databind.ser.impl.WritableObjectId objectId) |
protected void |
serializeFields(Object bean,
com.fasterxml.jackson.core.JsonGenerator gen0,
com.fasterxml.jackson.databind.SerializerProvider provider)
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 |
serializeFieldsFiltered(Object bean,
com.fasterxml.jackson.core.JsonGenerator gen0,
com.fasterxml.jackson.databind.SerializerProvider provider) |
void |
serializeWithType(Object bean,
com.fasterxml.jackson.core.JsonGenerator gen,
com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) |
_customTypeId, _serializeWithObjectId, _serializeWithObjectId, _typeIdDef, acceptJsonFormatVisitor, asArraySerializer, createContextual, findConvertingSerializer, getSchema, properties, resolve, serialize, usesObjectId, withByNameInclusion, withFilterId, withIgnorals, withIgnorals, withObjectIdWriter, withProperties
_neitherNull, _nonEmpty, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, replaceDelegatee, unwrappingSerializer
public static final String KEY_XML_INFO
BeanPropertyWriter
instances; to mark instances that are to be written out as attributes.
Created as separate non-interned String to ensure there are no collisions.protected final int _attributeCount
protected final int _textPropertyIndex
protected final QName[] _xmlNames
protected final BitSet _cdata
public XmlBeanSerializerBase(com.fasterxml.jackson.databind.ser.std.BeanSerializerBase src)
protected XmlBeanSerializerBase(XmlBeanSerializerBase src, com.fasterxml.jackson.databind.ser.impl.ObjectIdWriter objectIdWriter)
protected XmlBeanSerializerBase(XmlBeanSerializerBase src, com.fasterxml.jackson.databind.ser.impl.ObjectIdWriter objectIdWriter, Object filterId)
protected XmlBeanSerializerBase(XmlBeanSerializerBase src, Set<String> toIgnore, Set<String> toInclude)
public XmlBeanSerializerBase(XmlBeanSerializerBase src, com.fasterxml.jackson.databind.util.NameTransformer transformer)
protected XmlBeanSerializerBase(XmlBeanSerializerBase src, com.fasterxml.jackson.databind.ser.BeanPropertyWriter[] properties, com.fasterxml.jackson.databind.ser.BeanPropertyWriter[] filteredProperties)
protected void serializeFields(Object bean, com.fasterxml.jackson.core.JsonGenerator gen0, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException
serializeFields
in class com.fasterxml.jackson.databind.ser.std.BeanSerializerBase
IOException
protected void serializeFieldsFiltered(Object bean, com.fasterxml.jackson.core.JsonGenerator gen0, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException
serializeFieldsFiltered
in class com.fasterxml.jackson.databind.ser.std.BeanSerializerBase
IOException
public void serializeWithType(Object bean, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) throws IOException
serializeWithType
in class com.fasterxml.jackson.databind.ser.std.BeanSerializerBase
IOException
protected void _serializeObjectId(Object bean, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer, com.fasterxml.jackson.databind.ser.impl.WritableObjectId objectId) throws IOException
_serializeObjectId
in class com.fasterxml.jackson.databind.ser.std.BeanSerializerBase
IOException
protected static boolean _isAttribute(com.fasterxml.jackson.databind.ser.BeanPropertyWriter bpw)
protected static boolean _isCData(com.fasterxml.jackson.databind.ser.BeanPropertyWriter bpw)
protected static int _orderAttributesFirst(com.fasterxml.jackson.databind.ser.BeanPropertyWriter[] properties, com.fasterxml.jackson.databind.ser.BeanPropertyWriter[] filteredProperties)
Copyright © 2022 FasterXML. All rights reserved.