Top Description Inners Fields Constructors Methods
com.sun.tools.xjc.model

public final Class CElementPropertyInfo

extends CPropertyInfo
implements ElementPropertyInfo<NType, NClass>
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo, org.glassfish.jaxb.core.v2.model.core.PropertyInfo, org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource
Imports
java.util.AbstractList, .ArrayList, .List, .Map, jakarta.activation.MimeType, javax.xml.namespace.QName, com.sun.tools.xjc.model.nav.NClass, .NType, com.sun.tools.xjc.reader.RawTypeSet, org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo, .ID, .PropertyKind, com.sun.xml.xsom.XSComponent, org.xml.sax.Locator

ElementPropertyInfo for the compiler.
Author
Kohsuke Kawaguchi

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private CAdapter
adapter

Currently, this is set inside RawTypeSet in a very ugly way.

private final MimeType
private ID
private final boolean
private final List<CNonElement>
private final boolean
required

True if this property can never be absent legally.

private final List<CTypeRef>
types

List of referenced types.

Inherited from com.sun.tools.xjc.model.CPropertyInfo:
baseTypedefaultValueinlineBinaryDatajavadoclocatorrealization

Constructor Summary

AccessConstructor and Description
public
CElementPropertyInfo(String name, CElementPropertyInfo.CollectionMode collection, ID id, MimeType expectedMimeType, XSComponent source, CCustomizations customizations, Locator locator, boolean required)

Method Summary

Modifier and TypeMethod and Description
public <V> V
public <R, P> R
public QName
collectElementNames(Map<QName, CPropertyInfo> table)

Overrides com.sun.tools.xjc.model.CPropertyInfo.collectElementNames.

Puts the element names that this property possesses to the map, so that we can find two properties that own the same element name, which is an error.

public CAdapter
public MimeType
public QName
public List<CTypeRef>
getTypes()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.getTypes.

Returns the information about the types allowed in this property.

public QName
getXmlName()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.getXmlName.

Deprecated

XJC never uses the wrapper element.

public ID
id()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.id.

Returns the IDness of the value of this element.

public boolean
isCollectionNillable()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.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
public boolean
isOptionalPrimitive()

Overrides com.sun.tools.xjc.model.CPropertyInfo.isOptionalPrimitive.

Returns true if this property needs to represent null just for the purpose of representing an absence of the property.

public boolean
isRequired()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.isRequired.

Returns true if this element is mandatory.

public boolean
isUnboxable()

Overrides com.sun.tools.xjc.model.CPropertyInfo.isUnboxable.

Returns true if this property is "unboxable".

public boolean
isValueList()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.isValueList.

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

public PropertyKind
kind()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.kind.

Gets the kind of this property.

public List<CNonElement>
ref()

Implements abstract com.sun.tools.xjc.model.CPropertyInfo.ref.

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.ref.

List of TypeInfos that this property references.

public void
Inherited from com.sun.tools.xjc.model.CPropertyInfo:
displayNamegetCustomizationsgetLocatorgetNamegetNamegetSchemaComponenthasAnnotationinlineBinaryDataisCollectionneedsExplicitTypeNameparentreadAnnotationsetNamesetParent

Field Detail

adapterback to summary
private CAdapter adapter

Currently, this is set inside RawTypeSet in a very ugly way.

expectedMimeTypeback to summary
private final MimeType expectedMimeType
idback to summary
private ID id
isValueListback to summary
private final boolean isValueList
refback to summary
private final List<CNonElement> ref
requiredback to summary
private final boolean required

True if this property can never be absent legally.

typesback to summary
private final List<CTypeRef> types

List of referenced types.

Constructor Detail

CElementPropertyInfoback to summary
public CElementPropertyInfo(String name, CElementPropertyInfo.CollectionMode collection, ID id, MimeType expectedMimeType, XSComponent source, CCustomizations customizations, Locator locator, boolean required)

Method Detail

acceptback to summary
public <V> V accept(CPropertyVisitor<V> visitor)

Implements abstract com.sun.tools.xjc.model.CPropertyInfo.accept.

Annotations
@Override
acceptback to summary
public <R, P> R accept(CPropertyVisitor2<R, P> visitor, P p)

Implements abstract com.sun.tools.xjc.model.CPropertyInfo.accept.

Annotations
@Override
collectElementNamesback to summary
public QName collectElementNames(Map<QName, CPropertyInfo> table)

Overrides com.sun.tools.xjc.model.CPropertyInfo.collectElementNames.

Doc from com.sun.tools.xjc.model.CPropertyInfo.collectElementNames.

Puts the element names that this property possesses to the map, so that we can find two properties that own the same element name, which is an error.

Annotations
@Override
getAdapterback to summary
public CAdapter getAdapter()

Implements abstract com.sun.tools.xjc.model.CPropertyInfo.getAdapter.

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.getAdapter, org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getAdapter.

Annotations
@Override
getExpectedMimeTypeback to summary
public MimeType getExpectedMimeType()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getExpectedMimeType.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getExpectedMimeType.

Expected MIME type, if any.

Annotations
@Override
getSchemaTypeback to summary
public QName getSchemaType()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getSchemaType.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getSchemaType.

The effective value of XmlSchemaType annotation, if any.

If the property doesn't have XmlSchemaType annotation, this method returns null.

Since a type name is a property of a Java type, not a Java property, A schema type name of a Java type should be primarily obtained by using NonElement#getTypeName(). This method is to correctly implement the ugly semantics of XmlSchemaType (namely when this returns non-null, it overrides the type names of all types that are in this property.)

Annotations
@Override
getTypesback to summary
public List<CTypeRef> getTypes()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.getTypes.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.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.

Annotations
@Override
getXmlNameback to summary
public QName getXmlName()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.getXmlName.

Deprecated

XJC never uses the wrapper element. Always return null.

Annotations
@Deprecated
@Override
idback to summary
public ID id()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.id.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.id.

Returns the IDness of the value of this element.

Annotations
@Override
isCollectionNillableback to summary
public boolean isCollectionNillable()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.isCollectionNillable.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.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.

Annotations
@Override
isCollectionRequiredback to summary
public boolean isCollectionRequired()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.isCollectionRequired.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.isCollectionRequired.

Checks if the wrapper element is required.

Annotations
@Override
isOptionalPrimitiveback to summary
public boolean isOptionalPrimitive()

Overrides com.sun.tools.xjc.model.CPropertyInfo.isOptionalPrimitive.

Doc from com.sun.tools.xjc.model.CPropertyInfo.isOptionalPrimitive.

Returns true if this property needs to represent null just for the purpose of representing an absence of the property.

Annotations
@Override
isRequiredback to summary
public boolean isRequired()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.isRequired.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.isRequired.

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

Todo

define the semantics when this is a collection

Annotations
@Override
isUnboxableback to summary
public boolean isUnboxable()

Overrides com.sun.tools.xjc.model.CPropertyInfo.isUnboxable.

Doc from com.sun.tools.xjc.model.CPropertyInfo.isUnboxable.

Returns true if this property is "unboxable".

In general, a property often has to be capable of representing null to indicate the absence of the value. This requires properties to be generated as @XmlElement Float f, not as @XmlElement float f;. But this is slow.

Fortunately, there are cases where we know that the property can never legally be absent. When this condition holds we can generate the optimized "unboxed form".

The exact such conditions depend on the kind of properties, so refer to the implementation code for the details.

This method returns true when the property can be generated as "unboxed form", false otherwise.

When this property is a collection, this method returns true if items in the collection is unboxable. Obviously, the collection itself is always a reference type.

Annotations
@Override
isValueListback to summary
public boolean isValueList()

Implements org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.isValueList.

Doc from org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo.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.

Annotations
@Override
kindback to summary
public PropertyKind kind()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.kind.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.kind.

Gets the kind of this property.

Annotations
@Override
refback to summary
public List<CNonElement> ref()

Implements abstract com.sun.tools.xjc.model.CPropertyInfo.ref.

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.ref.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.ref.

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.

Annotations
@Override
setAdapterback to summary
public void setAdapter(CAdapter a)
com.sun.tools.xjc.model back to summary

public final Enum CElementPropertyInfo.CollectionMode

extends Enum<CElementPropertyInfo.CollectionMode>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final boolean
public static final CElementPropertyInfo.CollectionMode
public static final CElementPropertyInfo.CollectionMode
public static final CElementPropertyInfo.CollectionMode
private final boolean

Constructor Summary

AccessConstructor and Description
private
CollectionMode(boolean col, boolean val)

Method Summary

Modifier and TypeMethod and Description
public boolean
public static CElementPropertyInfo.CollectionMode
public static CElementPropertyInfo.CollectionMode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

colback to summary
private final boolean col
NOT_REPEATEDback to summary
public static final CElementPropertyInfo.CollectionMode NOT_REPEATED
REPEATED_ELEMENTback to summary
public static final CElementPropertyInfo.CollectionMode REPEATED_ELEMENT
REPEATED_VALUEback to summary
public static final CElementPropertyInfo.CollectionMode REPEATED_VALUE
valback to summary
private final boolean val

Constructor Detail

CollectionModeback to summary
private CollectionMode(boolean col, boolean val)

Method Detail

isRepeatedback to summary
public boolean isRepeated()
valueOfback to summary
public static CElementPropertyInfo.CollectionMode valueOf(String name)
valuesback to summary
public static CElementPropertyInfo.CollectionMode[] values()