| com.sun.xml.bind.v2.model.core.ElementPropertyInfo
ElementPropertyInfo | public interface ElementPropertyInfo extends PropertyInfo<T, C>(Code) | | Property that maps to an element.
author: Kohsuke Kawaguchi |
Method Summary | |
Adapter<T, C> | getAdapter() | List<? extends TypeRef<T, C>> | getTypes() 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.
Always non-null. | QName | getXmlName() Gets the wrapper element name. | boolean | isCollectionNillable() Returns true if this property is nillable
(meaning the absence of the value is treated as nil='true')
This method is only used when this property is a collection. | boolean | isCollectionRequired() Checks if the wrapper element is required. | boolean | isRequired() Returns true if this element is mandatory. | boolean | isValueList() Returns true if this property is a collection but its XML
representation is a list of values, not repeated elements. |
getTypes | List<? extends TypeRef<T, C>> getTypes()(Code) | | 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.
Always non-null. Contains at least one entry.If ElementPropertyInfo.isValueList()==true, there's always exactly one type. |
isCollectionNillable | boolean isCollectionNillable()(Code) | | Returns true if this property is nillable
(meaning the absence of the value is treated as nil='true')
This method is only used when this property is a collection.
|
isRequired | boolean isRequired()(Code) | | Returns true if this element is mandatory.
For collections, this property isn't used.
TODO: define the semantics when this is a collection
|
isValueList | boolean isValueList()(Code) | | Returns true if this property is a collection but its XML
representation is a list of values, not repeated elements.
If
ElementPropertyInfo.isCollection() ==false, this property is always false.
When this flag is true, getTypes().size()==1 always holds.
|
|
|