com.sun.xml.bind.v2.model.impl
Class RuntimeElementPropertyInfoImpl
java.lang.Object
com.sun.xml.bind.v2.model.impl.PropertyInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>
com.sun.xml.bind.v2.model.impl.ERPropertyInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>
com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl<Type,Class,Field,Method>
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
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 |
RuntimeElementPropertyInfoImpl
RuntimeElementPropertyInfoImpl(RuntimeClassInfoImpl classInfo,
PropertySeed<Type,Class,Field,Method> seed)
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
TypeInfo
s 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 TypeRef
s.
- 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.