Class AttributeProperty<BeanT>
java.lang.Object
com.sun.xml.bind.v2.runtime.property.AttributeProperty<BeanT>
- All Implemented Interfaces:
Property<BeanT>,StructureLoaderBuilder,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.
- Author:
- Kohsuke Kawaguchi (kk@kohsuke.org)
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal NameAttribute name.protected final StringName of this field.final TransducedAccessor<BeanT>Heart of the conversion logic.Fields inherited from interface com.sun.xml.bind.v2.runtime.property.StructureLoaderBuilder
CATCH_ALL, TEXT_HANDLER -
Constructor Summary
ConstructorsConstructorDescriptionAttributeProperty(JAXBContextImpl context, RuntimeAttributePropertyInfo prop) -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildChildElementUnmarshallers(UnmarshallerChain chainElem, QNameMap<ChildLoader> handlers) Every Property class has an implementation of buildChildElementUnmarshallers which will fill in the specifiedQNameMapby elements that are expected by this property.intcompareTo(AttributeProperty that) getElementPropertyAccessor(String nsUri, String localName) If this property is mapped to the specified element, return an accessor to it.getIdValue(BeanT bean) Gets the value of the property.getInfo()Provides moreRuntimePropertyInfoinformation on the property.getKind()Gets the Kind of propertybooleanReturns true ifProperty.serializeURIs(Object,XMLSerializer)performs some meaningful action.booleanvoidResets the property value on the given object.voidMarshals one attribute.voidserializeBody(BeanT o, XMLSerializer w, Object outerPeer) voidserializeURIs(BeanT o, XMLSerializer w) voidsetHiddenByOverride(boolean hidden) voidwrapUp()Called at the end of theJAXBContextinitialization phase to clean up any unnecessary references.
-
Field Details
-
attName
Attribute name. -
xacc
Heart of the conversion logic. -
fieldName
Name of this field.
-
-
Constructor Details
-
AttributeProperty
-
-
Method Details
-
serializeAttributes
public void serializeAttributes(BeanT o, XMLSerializer w) throws SAXException, AccessorException, IOException, XMLStreamException Marshals one attribute. -
serializeURIs
- Specified by:
serializeURIsin interfaceProperty<BeanT>- Throws:
AccessorExceptionSAXException- See Also:
-
hasSerializeURIAction
public boolean hasSerializeURIAction()Description copied from interface:PropertyReturns true ifProperty.serializeURIs(Object,XMLSerializer)performs some meaningful action.- Specified by:
hasSerializeURIActionin interfaceProperty<BeanT>
-
buildChildElementUnmarshallers
public void buildChildElementUnmarshallers(UnmarshallerChain chainElem, QNameMap<ChildLoader> handlers) Description copied from interface:StructureLoaderBuilderEvery Property class has an implementation of buildChildElementUnmarshallers which will fill in the specifiedQNameMapby elements that are expected by this property.- Specified by:
buildChildElementUnmarshallersin interfaceStructureLoaderBuilder
-
getKind
Description copied from interface:PropertyGets the Kind of property -
reset
Description copied from interface:PropertyResets the property value on the given object.... for example by setting 0 or null.
- Specified by:
resetin interfaceProperty<BeanT>- Throws:
AccessorException
-
getIdValue
Description copied from interface:PropertyGets the value of the property. This method is only used when the correspondingPropertyInfo.id()isID.ID, and therefore the return type is fixed toString.- Specified by:
getIdValuein interfaceProperty<BeanT>- Throws:
AccessorExceptionSAXException
-
compareTo
- Specified by:
compareToin interfaceComparable<BeanT>
-
getInfo
Description copied from interface:PropertyProvides moreRuntimePropertyInfoinformation on the property. -
serializeBody
public void serializeBody(BeanT o, XMLSerializer w, Object outerPeer) throws SAXException, AccessorException, IOException, XMLStreamException - Specified by:
serializeBodyin interfaceProperty<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 forJaxBeanInfoforJAXBElements.- Throws:
AccessorException- If thrown, caught by the caller and reported.SAXExceptionIOExceptionXMLStreamException- See Also:
-
getElementPropertyAccessor
Description copied from interface:PropertyIf this property is mapped to the specified element, return an accessor to it.- Specified by:
getElementPropertyAccessorin interfaceProperty<BeanT>- Returns:
- null if the property is not mapped to the specified element.
-
wrapUp
public void wrapUp()Description copied from interface:PropertyCalled at the end of theJAXBContextinitialization phase to clean up any unnecessary references. -
isHiddenByOverride
public boolean isHiddenByOverride()- Specified by:
isHiddenByOverridein interfaceProperty<BeanT>
-
setHiddenByOverride
public void setHiddenByOverride(boolean hidden) - Specified by:
setHiddenByOverridein interfaceProperty<BeanT>
-
getFieldName
- Specified by:
getFieldNamein interfaceProperty<BeanT>
-