public final class AttributeProperty<BeanT> extends Object implements Comparable<AttributeProperty>
Property implementation for AttributePropertyInfo.
This one works for both leaves and nodes, scalars and arrays.
Implements Comparable so that it can be sorted lexicographically.
| Modifier and Type | Field and Description |
|---|---|
Name |
attName
Attribute name.
|
protected String |
fieldName
Name of this field.
|
TransducedAccessor<BeanT> |
xacc
Heart of the conversion logic.
|
CATCH_ALL, TEXT_HANDLER| Constructor and Description |
|---|
AttributeProperty(JAXBContextImpl context,
RuntimeAttributePropertyInfo prop) |
| Modifier and Type | Method and Description |
|---|---|
void |
buildChildElementUnmarshallers(UnmarshallerChain chainElem,
QNameMap<ChildLoader> handlers)
Every Property class has an implementation of buildChildElementUnmarshallers
which will fill in the specified
QNameMap by elements that are expected
by this property. |
int |
compareTo(AttributeProperty that) |
Accessor |
getElementPropertyAccessor(String nsUri,
String localName)
If this property is mapped to the specified element,
return an accessor to it.
|
String |
getFieldName() |
String |
getIdValue(BeanT bean)
Gets the value of the property.
|
RuntimePropertyInfo |
getInfo()
Provides more
RuntimePropertyInfo information on the property. |
PropertyKind |
getKind()
Gets the Kind of property
|
boolean |
hasSerializeURIAction()
Returns true if
Property.serializeURIs(Object,XMLSerializer) performs some meaningful action. |
boolean |
isHiddenByOverride() |
void |
reset(BeanT o)
Resets the property value on the given object.
|
void |
serializeAttributes(BeanT o,
XMLSerializer w)
Marshals one attribute.
|
void |
serializeBody(BeanT o,
XMLSerializer w,
Object outerPeer) |
void |
serializeURIs(BeanT o,
XMLSerializer w) |
void |
setHiddenByOverride(boolean hidden) |
void |
wrapUp()
Called at the end of the
JAXBContext initialization phase
to clean up any unnecessary references. |
public final Name attName
public final TransducedAccessor<BeanT> xacc
protected final String fieldName
public AttributeProperty(JAXBContextImpl context, RuntimeAttributePropertyInfo prop)
public void serializeAttributes(BeanT o, XMLSerializer w) throws SAXException, AccessorException, IOException, XMLStreamException
public void serializeURIs(BeanT o, XMLSerializer w) throws AccessorException, SAXException
serializeURIs in interface Property<BeanT>AccessorExceptionSAXExceptionJaxBeanInfo.serializeURIs(Object, XMLSerializer)public boolean hasSerializeURIAction()
PropertyProperty.serializeURIs(Object,XMLSerializer) performs some meaningful action.hasSerializeURIAction in interface Property<BeanT>public void buildChildElementUnmarshallers(UnmarshallerChain chainElem, QNameMap<ChildLoader> handlers)
StructureLoaderBuilderQNameMap by elements that are expected
by this property.buildChildElementUnmarshallers in interface StructureLoaderBuilderpublic PropertyKind getKind()
Propertypublic void reset(BeanT o) throws AccessorException
Property... for example by setting 0 or null.
reset in interface Property<BeanT>AccessorExceptionpublic String getIdValue(BeanT bean) throws AccessorException, SAXException
PropertyPropertyInfo.id() is ID.ID,
and therefore the return type is fixed to String.getIdValue in interface Property<BeanT>AccessorExceptionSAXExceptionpublic int compareTo(AttributeProperty that)
compareTo in interface Comparable<AttributeProperty>public RuntimePropertyInfo getInfo()
PropertyRuntimePropertyInfo information on the property.getInfo in interface Property<BeanT>JAXBContextpublic void serializeBody(BeanT o,
XMLSerializer w,
Object outerPeer)
throws SAXException,
AccessorException,
IOException,
XMLStreamException
serializeBody in interface Property<BeanT>outerPeer - used when this property is expected to print out an element
and that should be associated with this outer peer. normally null.
this is only used for JaxBeanInfo for JAXBElements.AccessorException - If thrown, caught by the caller and reported.SAXExceptionIOExceptionXMLStreamExceptionJaxBeanInfo.serializeBody(Object, XMLSerializer)public Accessor getElementPropertyAccessor(String nsUri, String localName)
PropertygetElementPropertyAccessor in interface Property<BeanT>public void wrapUp()
PropertyJAXBContext initialization phase
to clean up any unnecessary references.public boolean isHiddenByOverride()
isHiddenByOverride in interface Property<BeanT>public void setHiddenByOverride(boolean hidden)
setHiddenByOverride in interface Property<BeanT>public String getFieldName()
getFieldName in interface Property<BeanT>Copyright © 2018 JBoss by Red Hat. All rights reserved.