Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.runtime.property

public final Class AttributeProperty<BeanT>

extends PropertyImpl<BeanT>
implements Comparable<AttributeProperty<BeanT>>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Imports
org.glassfish.jaxb.runtime.api.AccessorException, org.glassfish.jaxb.core.v2.model.core.AttributePropertyInfo, .PropertyKind, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeAttributePropertyInfo, org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl, .JaxBeanInfo, .Name, .XMLSerializer, org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor, .TransducedAccessor, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.ChildLoader, org.glassfish.jaxb.runtime.v2.util.QNameMap, org.xml.sax.SAXException, javax.xml.stream.XMLStreamException, java.io.IOException

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 ([email protected])

Field Summary

Modifier and TypeField and Description
private final Accessor<BeanT, ValueT>
public final Name
attName

Attribute name.

public final TransducedAccessor<BeanT>
xacc

Heart of the conversion logic.

Inherited from org.glassfish.jaxb.runtime.v2.runtime.property.PropertyImpl:
fieldName

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
buildChildElementUnmarshallers(UnmarshallerChain chainElem, QNameMap<ChildLoader> handlers)

Implements org.glassfish.jaxb.runtime.v2.runtime.property.StructureLoaderBuilder.buildChildElementUnmarshallers.

Every Property class has an implementation of buildChildElementUnmarshallers which will fill in the specified QNameMap by elements that are expected by this property.

public int
compareTo(AttributeProperty<BeanT> that)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public String
getIdValue(BeanT bean)

Implements org.glassfish.jaxb.runtime.v2.runtime.property.Property.getIdValue.

Gets the value of the property.

public PropertyKind
public boolean
public void
reset(BeanT o)

Implements org.glassfish.jaxb.runtime.v2.runtime.property.Property.reset.

Resets the property value on the given object.

public void
serializeAttributes(BeanT o, XMLSerializer w)

Marshals one attribute.

public void
Inherited from org.glassfish.jaxb.runtime.v2.runtime.property.PropertyImpl:
getElementPropertyAccessorgetFieldNamegetInfoisHiddenByOverrideserializeBodysetHiddenByOverridewrapUp

Field Detail

accback to summary
private final Accessor<BeanT, ValueT> acc
attNameback to summary
public final Name attName

Attribute name.

xaccback to summary
public final TransducedAccessor<BeanT> xacc

Heart of the conversion logic.

Constructor Detail

AttributePropertyback to summary
public AttributeProperty(JAXBContextImpl context, RuntimeAttributePropertyInfo prop)

Method Detail

buildChildElementUnmarshallersback to summary
public void buildChildElementUnmarshallers(UnmarshallerChain chainElem, QNameMap<ChildLoader> handlers)

Implements org.glassfish.jaxb.runtime.v2.runtime.property.StructureLoaderBuilder.buildChildElementUnmarshallers.

Doc from org.glassfish.jaxb.runtime.v2.runtime.property.StructureLoaderBuilder.buildChildElementUnmarshallers.

Every Property class has an implementation of buildChildElementUnmarshallers which will fill in the specified QNameMap by elements that are expected by this property.

Annotations
@Override
compareToback to summary
public int compareTo(AttributeProperty<BeanT> that)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
getIdValueback to summary
public String getIdValue(BeanT bean) throws AccessorException, SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.property.Property.getIdValue.

Doc from org.glassfish.jaxb.runtime.v2.runtime.property.Property.getIdValue.

Gets the value of the property. This method is only used when the corresponding PropertyInfo#id() is ID#ID, and therefore the return type is fixed to String.

Annotations
@Override
getKindback to summary
public PropertyKind getKind()

Implements org.glassfish.jaxb.runtime.v2.runtime.property.Property.getKind.

Doc from org.glassfish.jaxb.runtime.v2.runtime.property.Property.getKind.

Gets the Kind of property

Annotations
@Override
hasSerializeURIActionback to summary
public boolean hasSerializeURIAction()

Overrides org.glassfish.jaxb.runtime.v2.runtime.property.PropertyImpl.hasSerializeURIAction.

Implements org.glassfish.jaxb.runtime.v2.runtime.property.Property.hasSerializeURIAction.

Doc from org.glassfish.jaxb.runtime.v2.runtime.property.Property.hasSerializeURIAction.

Returns true if serializeURIs(Object, XMLSerializer) performs some meaningful action.

Annotations
@Override
resetback to summary
public void reset(BeanT o) throws AccessorException

Implements org.glassfish.jaxb.runtime.v2.runtime.property.Property.reset.

Doc from org.glassfish.jaxb.runtime.v2.runtime.property.Property.reset.

Resets the property value on the given object.

... for example by setting 0 or null.

Annotations
@Override
serializeAttributesback to summary
public void serializeAttributes(BeanT o, XMLSerializer w) throws SAXException, AccessorException, IOException, XMLStreamException

Marshals one attribute.

See Also
JaxBeanInfo#serializeAttributes(Object, XMLSerializer)
serializeURIsback to summary
public void serializeURIs(BeanT o, XMLSerializer w) throws AccessorException, SAXException

Overrides org.glassfish.jaxb.runtime.v2.runtime.property.PropertyImpl.serializeURIs.

Implements org.glassfish.jaxb.runtime.v2.runtime.property.Property.serializeURIs.

Annotations
@Override