Module com.sun.xml.bind
Class ValueProperty<BeanT>
- java.lang.Object
-
- org.glassfish.jaxb.runtime.v2.runtime.property.ValueProperty<BeanT>
-
- All Implemented Interfaces:
Property<BeanT>,StructureLoaderBuilder
public final class ValueProperty<BeanT> extends Object
Propertyimplementation forXmlValueproperties.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 StringfieldNameName of this field.-
Fields inherited from interface org.glassfish.jaxb.runtime.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 voidbuildChildElementUnmarshallers(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.AccessorgetElementPropertyAccessor(String nsUri, String localName)If this property is mapped to the specified element, return an accessor to it.StringgetFieldName()StringgetIdValue(BeanT bean)Gets the value of the property.RuntimePropertyInfogetInfo()Provides moreRuntimePropertyInfoinformation on the property.PropertyKindgetKind()Gets the Kind of propertybooleanhasSerializeURIAction()Returns true ifProperty.serializeURIs(Object,XMLSerializer)performs some meaningful action.booleanisHiddenByOverride()voidreset(BeanT o)Resets the property value on the given object.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 Detail
-
fieldName
protected final String fieldName
Name of this field.
-
-
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, 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:
JaxBeanInfo.serializeBody(Object, XMLSerializer)
-
serializeURIs
public void serializeURIs(BeanT o, XMLSerializer w) throws SAXException, AccessorException
- Specified by:
serializeURIsin interfaceProperty<BeanT>- Throws:
SAXExceptionAccessorException- See Also:
JaxBeanInfo.serializeURIs(Object, XMLSerializer)
-
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.
-
getKind
public PropertyKind getKind()
Description copied from interface:PropertyGets the Kind of property- Returns:
- always non-null.
-
reset
public void reset(BeanT o) throws AccessorException
Description copied from interface:PropertyResets 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: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.- Throws:
AccessorExceptionSAXException
-
getInfo
public RuntimePropertyInfo getInfo()
Description copied from interface:PropertyProvides moreRuntimePropertyInfoinformation on the property.
-
getElementPropertyAccessor
public Accessor getElementPropertyAccessor(String nsUri, String localName)
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
public String getFieldName()
- Specified by:
getFieldNamein interfaceProperty<BeanT>
-
-