Interface RuntimeElementPropertyInfo
-
- All Superinterfaces:
AnnotationSource
,ElementPropertyInfo<java.lang.reflect.Type,java.lang.Class>
,PropertyInfo<java.lang.reflect.Type,java.lang.Class>
,RuntimePropertyInfo
public interface RuntimeElementPropertyInfo extends ElementPropertyInfo<java.lang.reflect.Type,java.lang.Class>, RuntimePropertyInfo
- Author:
- Kohsuke Kawaguchi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<? extends RuntimeTypeRef>
getTypes()
Returns the information about the types allowed in this property.java.util.Collection<? extends RuntimeTypeInfo>
ref()
List ofTypeInfo
s that this property references.-
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.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.runtime.RuntimePropertyInfo
elementOnlyContent, getAccessor, getIndividualType, getRawType
-
-
-
-
Method Detail
-
ref
java.util.Collection<? extends RuntimeTypeInfo> ref()
List ofTypeInfo
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 interfacePropertyInfo<java.lang.reflect.Type,java.lang.Class>
- Specified by:
ref
in interfaceRuntimePropertyInfo
- Returns:
- non-null read-only collection.
-
getTypes
java.util.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 toString
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 interfaceElementPropertyInfo<java.lang.reflect.Type,java.lang.Class>
- Returns:
- Always non-null. Contains at least one entry.
If
ElementPropertyInfo.isValueList()
==true, there's always exactly one type.
-
-