com.sun.xml.bind.v2.model.impl
Class RuntimeElementPropertyInfoImpl

java.lang.Object
  extended by com.sun.xml.bind.v2.model.impl.PropertyInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>
      extended by com.sun.xml.bind.v2.model.impl.ERPropertyInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>
          extended by com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl<Type,Class,Field,Method>
              extended by com.sun.xml.bind.v2.model.impl.RuntimeElementPropertyInfoImpl
All Implemented Interfaces:
AnnotationSource, Locatable, ElementPropertyInfo<Type,Class>, PropertyInfo<Type,Class>, RuntimeElementPropertyInfo, RuntimePropertyInfo, Comparable<PropertyInfoImpl>

 class RuntimeElementPropertyInfoImpl
extends ElementPropertyInfoImpl<Type,Class,Field,Method>
implements RuntimeElementPropertyInfo


Field Summary
 
Fields inherited from class com.sun.xml.bind.v2.model.impl.PropertyInfoImpl
parent, seed
 
Constructor Summary
RuntimeElementPropertyInfoImpl(RuntimeClassInfoImpl classInfo, PropertySeed<Type,Class,Field,Method> seed)
           
 
Method Summary
protected  RuntimeTypeRefImpl createTypeRef(QName name, Type type, boolean isNillable, String defaultValue)
          Used by PropertyInfoImpl to create new instances of TypeRef
 boolean elementOnlyContent()
          Returns true if this property has an element-only content.
 Accessor getAccessor()
          Gets the Accessor for this property.
 List<RuntimeTypeRefImpl> getTypes()
          Returns the information about the types allowed in this property.
 List<? extends RuntimeTypeInfo> ref()
          List of TypeInfos that this property references.
 
Methods inherited from class com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl
isRequired, isValueList, kind, link
 
Methods inherited from class com.sun.xml.bind.v2.model.impl.ERPropertyInfoImpl
getXmlName, isCollectionNillable, isCollectionRequired
 
Methods inherited from class com.sun.xml.bind.v2.model.impl.PropertyInfoImpl
calcXmlName, calcXmlName, compareTo, displayName, getAdapter, getExpectedMimeType, getIndividualType, getLocation, getName, getRawType, getSchemaType, getUpstream, hasAnnotation, id, inlineBinaryData, isCollection, nav, parent, readAnnotation, reader
 
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.runtime.RuntimePropertyInfo
getIndividualType, getRawType
 
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
 

Constructor Detail

RuntimeElementPropertyInfoImpl

RuntimeElementPropertyInfoImpl(RuntimeClassInfoImpl classInfo,
                               PropertySeed<Type,Class,Field,Method> seed)
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()

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

ref

public List<? extends RuntimeTypeInfo> 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 ElementPropertyInfoImpl<Type,Class,Field,Method>
Returns:
non-null read-only collection.

createTypeRef

protected RuntimeTypeRefImpl createTypeRef(QName name,
                                           Type type,
                                           boolean isNillable,
                                           String defaultValue)
Description copied from class: ElementPropertyInfoImpl
Used by PropertyInfoImpl to create new instances of TypeRef

Overrides:
createTypeRef in class ElementPropertyInfoImpl<Type,Class,Field,Method>

getTypes

public List<RuntimeTypeRefImpl> 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 ElementPropertyInfoImpl<Type,Class,Field,Method>
Returns:
Always non-null. Contains at least one entry. If ElementPropertyInfo.isValueList()==true, there's always exactly one type.