com.sun.xml.bind.v2.runtime.property
Class ValueProperty<BeanT>

java.lang.Object
  extended by com.sun.xml.bind.v2.runtime.property.PropertyImpl<BeanT>
      extended by com.sun.xml.bind.v2.runtime.property.ValueProperty<BeanT>
All Implemented Interfaces:
Property<BeanT>, StructureLoaderBuilder

public final class ValueProperty<BeanT>
extends PropertyImpl<BeanT>

Property implementation for XmlValue properties.

This one works for both leaves and nodes, scalars and arrays.


Field Summary
 
Fields inherited from class com.sun.xml.bind.v2.runtime.property.PropertyImpl
fieldName
 
Fields inherited from interface com.sun.xml.bind.v2.runtime.property.StructureLoaderBuilder
CATCH_ALL, TEXT_HANDLER
 
Constructor Summary
ValueProperty(JAXBContextImpl context, RuntimeValuePropertyInfo prop)
           
 
Method Summary
 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.
 String getIdValue(BeanT bean)
          Gets the value of the property.
 PropertyKind getKind()
          Gets the Kind of property
 boolean hasSerializeURIAction()
          Returns true if Property.serializeURIs(Object,XMLSerializer) performs some meaningful action.
 void reset(BeanT o)
          Resets the property value on the given object.
 void serializeBody(BeanT o, XMLSerializer w, Object outerPeer)
           
 void serializeURIs(BeanT o, XMLSerializer w)
           
 
Methods inherited from class com.sun.xml.bind.v2.runtime.property.PropertyImpl
getElementPropertyAccessor, wrapUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueProperty

public ValueProperty(JAXBContextImpl context,
                     RuntimeValuePropertyInfo prop)
Method Detail

serializeBody

public final void serializeBody(BeanT o,
                                XMLSerializer w,
                                Object outerPeer)
                         throws SAXException,
                                AccessorException,
                                IOException,
                                javax.xml.stream.XMLStreamException
Specified by:
serializeBody in interface Property<BeanT>
Overrides:
serializeBody in class PropertyImpl<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.
Throws:
AccessorException - If thrown, caught by the caller and reported.
SAXException
IOException
javax.xml.stream.XMLStreamException
See Also:
JaxBeanInfo.serializeBody(Object, XMLSerializer)

serializeURIs

public void serializeURIs(BeanT o,
                          XMLSerializer w)
                   throws SAXException,
                          AccessorException
Specified by:
serializeURIs in interface Property<BeanT>
Overrides:
serializeURIs in class PropertyImpl<BeanT>
Throws:
SAXException
AccessorException
See Also:
JaxBeanInfo.serializeURIs(Object, XMLSerializer)

hasSerializeURIAction

public boolean hasSerializeURIAction()
Description copied from interface: Property
Returns true if Property.serializeURIs(Object,XMLSerializer) performs some meaningful action.

Specified by:
hasSerializeURIAction in interface Property<BeanT>
Overrides:
hasSerializeURIAction in class PropertyImpl<BeanT>

buildChildElementUnmarshallers

public void buildChildElementUnmarshallers(UnmarshallerChain chainElem,
                                           QNameMap<ChildLoader> handlers)
Description copied from interface: StructureLoaderBuilder
Every Property class has an implementation of buildChildElementUnmarshallers which will fill in the specified QNameMap by elements that are expected by this property.


getKind

public PropertyKind getKind()
Description copied from interface: Property
Gets the Kind of property

Returns:
always non-null.

reset

public void reset(BeanT o)
           throws AccessorException
Description copied from interface: Property
Resets the property value on the given object.

... for example by setting 0 or null.

Throws:
AccessorException

getIdValue

public String getIdValue(BeanT bean)
                  throws AccessorException,
                         SAXException
Description copied from interface: Property
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.

Throws:
AccessorException
SAXException