Top Description Methods
org.glassfish.jaxb.core.v2.model.core

public Interface ElementPropertyInfo<T, C>

extends PropertyInfo<T, C>
Known Direct Subinterfaces
org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeElementPropertyInfo
Known Direct Implementers
org.glassfish.jaxb.runtime.v2.model.impl.ElementInfoImpl.PropertyImpl, org.glassfish.jaxb.runtime.v2.model.impl.ElementPropertyInfoImpl, com.sun.tools.xjc.model.CElementPropertyInfo
Imports
java.util.List, javax.xml.namespace.QName

Property that maps to an element.
Author
Kohsuke Kawaguchi

Method Summary

Modifier and TypeMethod and Description
public Adapter<T, C>
public List<? extends TypeRef<T, C>>

Returns:

Always non-null. Contains at least one entry. If isValueList()==true, there's always exactly one type.
getTypes
()

Returns the information about the types allowed in this property.

public QName

Returns:

must be null if isCollection()==false or if isValueList()==true. Otherwise, this can be null (in which case there'll be no wrapper), or it can be non-null (in which case there'll be a wrapper)
getXmlName
()

Gets the wrapper element name.

public 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.

public boolean

Returns:

Always false if getXmlName()==null.
isCollectionRequired
()

Checks if the wrapper element is required.

public boolean
isRequired()

Returns true if this element is mandatory.

public boolean
isValueList()

Returns true if this property is a collection but its XML representation is a list of values, not repeated elements.

Inherited from org.glassfish.jaxb.core.v2.model.core.PropertyInfo:
displayNamegetExpectedMimeTypegetNamegetSchemaTypeidinlineBinaryDataisCollectionkindparentref

Method Detail

getAdapterback to summary
public Adapter<T, C> getAdapter()

Redeclares org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getAdapter.

Annotations
@Override
getTypesback to summary
public 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 TypeRefs.

Returns:List<? extends TypeRef<T, C>>

Always non-null. Contains at least one entry. If isValueList()==true, there's always exactly one type.

getXmlNameback to summary
public QName getXmlName()

Gets the wrapper element name.

Returns:QName

must be null if isCollection()==false or if isValueList()==true. Otherwise, this can be null (in which case there'll be no wrapper), or it can be non-null (in which case there'll be a wrapper)

isCollectionNillableback to summary
public 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.

isCollectionRequiredback to summary
public boolean isCollectionRequired()

Checks if the wrapper element is required.

Returns:boolean

Always false if getXmlName()==null.

isRequiredback to summary
public boolean isRequired()

Returns true if this element is mandatory. For collections, this property isn't used.

Todo

define the semantics when this is a collection

isValueListback to summary
public boolean isValueList()

Returns true if this property is a collection but its XML representation is a list of values, not repeated elements.

If isCollection()==false, this property is always false.

When this flag is true, getTypes().size()==1 always holds.