Class ValueProperty<BeanT>
- java.lang.Object
-
- com.sun.xml.bind.v2.runtime.property.ValueProperty<BeanT>
-
- All Implemented Interfaces:
Property<BeanT>
,StructureLoaderBuilder
public final class ValueProperty<BeanT> extends java.lang.Object
Property
implementation forXmlValue
properties.This one works for both leaves and nodes, scalars and arrays.
- Author:
- Bhakti Mehta (bhakti.mehta@sun.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
fieldName
Name of this field.-
Fields inherited from interface com.sun.xml.bind.v2.runtime.property.StructureLoaderBuilder
CATCH_ALL, TEXT_HANDLER
-
-
Constructor Summary
Constructors Constructor Description ValueProperty(JAXBContextImpl context, RuntimeValuePropertyInfo prop)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildChildElementUnmarshallers(UnmarshallerChain chainElem, QNameMap<ChildLoader> handlers)
Every Property class has an implementation of buildChildElementUnmarshallers which will fill in the specifiedQNameMap
by elements that are expected by this property.Accessor
getElementPropertyAccessor(java.lang.String nsUri, java.lang.String localName)
If this property is mapped to the specified element, return an accessor to it.java.lang.String
getFieldName()
java.lang.String
getIdValue(BeanT bean)
Gets the value of the property.RuntimePropertyInfo
getInfo()
Provides moreRuntimePropertyInfo
information on the property.PropertyKind
getKind()
Gets the Kind of propertyboolean
hasSerializeURIAction()
Returns true ifProperty.serializeURIs(Object,XMLSerializer)
performs some meaningful action.boolean
isHiddenByOverride()
void
reset(BeanT o)
Resets the property value on the given object.void
serializeBody(BeanT o, XMLSerializer w, java.lang.Object outerPeer)
void
serializeURIs(BeanT o, XMLSerializer w)
void
setHiddenByOverride(boolean hidden)
void
wrapUp()
Called at the end of theJAXBContext
initialization phase to clean up any unnecessary references.
-
-
-
Constructor Detail
-
ValueProperty
public ValueProperty(JAXBContextImpl context, RuntimeValuePropertyInfo prop)
-
-
Method Detail
-
serializeBody
public final void serializeBody(BeanT o, XMLSerializer w, java.lang.Object outerPeer) throws org.xml.sax.SAXException, AccessorException, java.io.IOException, javax.xml.stream.XMLStreamException
- Specified by:
serializeBody
in 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 forJaxBeanInfo
forJAXBElement
s.- Throws:
AccessorException
- If thrown, caught by the caller and reported.org.xml.sax.SAXException
java.io.IOException
javax.xml.stream.XMLStreamException
- See Also:
JaxBeanInfo.serializeBody(Object, XMLSerializer)
-
serializeURIs
public void serializeURIs(BeanT o, XMLSerializer w) throws org.xml.sax.SAXException, AccessorException
- Specified by:
serializeURIs
in interfaceProperty<BeanT>
- Throws:
org.xml.sax.SAXException
AccessorException
- See Also:
JaxBeanInfo.serializeURIs(Object, XMLSerializer)
-
hasSerializeURIAction
public boolean hasSerializeURIAction()
Description copied from interface:Property
Returns true ifProperty.serializeURIs(Object,XMLSerializer)
performs some meaningful action.- Specified by:
hasSerializeURIAction
in interfaceProperty<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 specifiedQNameMap
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 java.lang.String getIdValue(BeanT bean) throws AccessorException, org.xml.sax.SAXException
Description copied from interface:Property
Gets the value of the property. This method is only used when the correspondingPropertyInfo.id()
isID.ID
, and therefore the return type is fixed toString
.- Throws:
AccessorException
org.xml.sax.SAXException
-
getInfo
public RuntimePropertyInfo getInfo()
Description copied from interface:Property
Provides moreRuntimePropertyInfo
information on the property.
-
getElementPropertyAccessor
public Accessor getElementPropertyAccessor(java.lang.String nsUri, java.lang.String localName)
Description copied from interface:Property
If this property is mapped to the specified element, return an accessor to it.- Specified by:
getElementPropertyAccessor
in interfaceProperty<BeanT>
- Returns:
- null if the property is not mapped to the specified element.
-
wrapUp
public void wrapUp()
Description copied from interface:Property
Called at the end of theJAXBContext
initialization phase to clean up any unnecessary references.
-
isHiddenByOverride
public boolean isHiddenByOverride()
- Specified by:
isHiddenByOverride
in interfaceProperty<BeanT>
-
setHiddenByOverride
public void setHiddenByOverride(boolean hidden)
- Specified by:
setHiddenByOverride
in interfaceProperty<BeanT>
-
getFieldName
public java.lang.String getFieldName()
- Specified by:
getFieldName
in interfaceProperty<BeanT>
-
-