com.sun.xml.bind.v2.model.impl
Class RuntimeElementInfoImpl.RuntimePropertyImpl

java.lang.Object
  extended by com.sun.xml.bind.v2.model.impl.ElementInfoImpl.PropertyImpl
      extended by com.sun.xml.bind.v2.model.impl.RuntimeElementInfoImpl.RuntimePropertyImpl
All Implemented Interfaces:
AnnotationSource, ElementPropertyInfo<Type,Class>, NonElementRef<Type,Class>, PropertyInfo<Type,Class>, TypeRef<Type,Class>, RuntimeElementPropertyInfo, RuntimeNonElementRef, RuntimePropertyInfo, RuntimeTypeRef
Enclosing class:
RuntimeElementInfoImpl

 class RuntimeElementInfoImpl.RuntimePropertyImpl
extends ElementInfoImpl.PropertyImpl
implements RuntimeElementPropertyInfo, RuntimeTypeRef


Constructor Summary
RuntimeElementInfoImpl.RuntimePropertyImpl()
           
 
Method Summary
 boolean elementOnlyContent()
          Returns true if this property has an element-only content.
 Accessor getAccessor()
          Gets the Accessor for this property.
 Type getIndividualType()
          Gets the type of the individual item.
 Type getRawType()
          Gets the "raw" type of the field.
 RuntimePropertyInfo getSource()
          Gets the property which is the source of this reference.
 RuntimeNonElement getTarget()
          Target of the reference.
 Transducer getTransducer()
          If the XML representation of the referenced Java type is just a text, return a transducer that converts between the bean and XML.
 List<? extends RuntimeTypeRef> getTypes()
          Returns the information about the types allowed in this property.
 List<? extends RuntimeNonElement> ref()
          List of TypeInfos that this property references.
 
Methods inherited from class com.sun.xml.bind.v2.model.impl.ElementInfoImpl.PropertyImpl
displayName, getAdapter, getDefaultValue, getExpectedMimeType, getName, getSchemaType, getTagName, getXmlName, hasAnnotation, id, inlineBinaryData, isCollection, isCollectionNillable, isCollectionRequired, isNillable, isRequired, isValueList, kind, parent, readAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.ElementPropertyInfo
getAdapter, getXmlName, isCollectionNillable, isCollectionRequired, isRequired, isValueList
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.PropertyInfo
displayName, getExpectedMimeType, getName, getSchemaType, id, inlineBinaryData, isCollection, kind, parent
 
Methods inherited from interface com.sun.xml.bind.v2.model.annotation.AnnotationSource
hasAnnotation, readAnnotation
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.TypeRef
getDefaultValue, getTagName, isNillable
 

Constructor Detail

RuntimeElementInfoImpl.RuntimePropertyImpl

RuntimeElementInfoImpl.RuntimePropertyImpl()
Method Detail

getAccessor

public Accessor getAccessor()
Description copied from interface: RuntimePropertyInfo
Gets the Accessor for this property.

Even for a multi-value property, this method returns an accessor to that property. IOW, the accessor works against the raw type.

This methods returns unoptimized accessor (because optimization accessors are often combined into bigger pieces, and optimization generally works better if you can look at a bigger piece, as opposed to individually optimize a smaller components)

Specified by:
getAccessor in interface RuntimePropertyInfo
Returns:
never null.
See Also:
Accessor#optimize()

getRawType

public Type getRawType()
Description copied from interface: RuntimePropertyInfo
Gets the "raw" type of the field. The raw type is the actual signature of the property. For example, if the field is the primitive int, this will be the primitive int. If the field is Object, this will be Object. If the property is the collection and typed as Collection<Integer>, this method returns Collection<Integer>.

Specified by:
getRawType in interface RuntimePropertyInfo
Returns:
always non-null.

getIndividualType

public Type getIndividualType()
Description copied from interface: RuntimePropertyInfo
Gets the type of the individual item. The individual type is the signature of the property used to store individual values. For a non-collection field, this is the same as RuntimePropertyInfo.getRawType(). For acollection property, this is the type used to store individual value. So if RuntimePropertyInfo.getRawType() is Collection<Integer>, this method will return Integer.

Specified by:
getIndividualType in interface RuntimePropertyInfo
Returns:
always non-null.

elementOnlyContent

public boolean elementOnlyContent()
Description copied from interface: RuntimePropertyInfo
Returns true if this property has an element-only content. False otherwise.

Specified by:
elementOnlyContent in interface RuntimePropertyInfo

getTypes

public List<? extends RuntimeTypeRef> getTypes()
Description copied from interface: ElementPropertyInfo
Returns the information about the types allowed in this property.

In a simple case like the following, an element property only has one TypeRef that points to String and tag name "foo".

 @XmlElement
 String abc;
 

However, in a general case an element property can be heterogeneous, meaning you can put different types in it, each with a different tag name (and a few other settings.)

 // list can contain String or Integer.
 @XmlElements({
   @XmlElement(name="a",type=String.class),
   @XmlElement(name="b",type=Integer.class),
 })
 List<Object> abc;
 

In this case this method returns a list of two TypeRefs.

Specified by:
getTypes in interface ElementPropertyInfo<Type,Class>
Specified by:
getTypes in interface RuntimeElementPropertyInfo
Overrides:
getTypes in class ElementInfoImpl.PropertyImpl
Returns:
Always non-null. Contains at least one entry. If ElementPropertyInfo.isValueList()==true, there's always exactly one type.

ref

public List<? extends RuntimeNonElement> ref()
Description copied from interface: PropertyInfo
List of TypeInfos that this property references. This allows the caller to traverse the reference graph without getting into the details of each different property type.

Specified by:
ref in interface PropertyInfo<Type,Class>
Specified by:
ref in interface RuntimeElementPropertyInfo
Specified by:
ref in interface RuntimePropertyInfo
Overrides:
ref in class ElementInfoImpl.PropertyImpl
Returns:
non-null read-only collection.

getTarget

public RuntimeNonElement getTarget()
Description copied from interface: NonElementRef
Target of the reference.

Specified by:
getTarget in interface NonElementRef<Type,Class>
Specified by:
getTarget in interface RuntimeNonElementRef
Specified by:
getTarget in interface RuntimeTypeRef
Overrides:
getTarget in class ElementInfoImpl.PropertyImpl
Returns:
never null

getSource

public RuntimePropertyInfo getSource()
Description copied from interface: NonElementRef
Gets the property which is the source of this reference.

Specified by:
getSource in interface NonElementRef<Type,Class>
Specified by:
getSource in interface RuntimeNonElementRef
Specified by:
getSource in interface RuntimeTypeRef
Overrides:
getSource in class ElementInfoImpl.PropertyImpl
Returns:
never null

getTransducer

public Transducer getTransducer()
Description copied from interface: RuntimeNonElementRef
If the XML representation of the referenced Java type is just a text, return a transducer that converts between the bean and XML.

Specified by:
getTransducer in interface RuntimeNonElementRef