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

public final Class CReferencePropertyInfo

extends CPropertyInfo
implements ReferencePropertyInfo<NType, NClass>
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo, org.glassfish.jaxb.core.v2.model.core.PropertyInfo, org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource
Imports
java.util.Collection, .LinkedHashSet, .Set, .Map, jakarta.activation.MimeType, jakarta.xml.bind.annotation.W3CDomHandler, javax.xml.namespace.QName, com.sun.tools.xjc.model.nav.NClass, .NType, .NavigatorImpl, org.glassfish.jaxb.core.v2.model.core.ID, .PropertyKind, .ReferencePropertyInfo, .WildcardMode, com.sun.xml.xsom.XSComponent, org.xml.sax.Locator

ReferencePropertyInfo for the compiler.
Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private final Set<CElement>
elements

List of referenced elements.

private final boolean
private boolean
private final boolean
required

True if this property can never be absent legally.

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

Constructor Summary

AccessConstructor and Description
public
CReferencePropertyInfo(String name, boolean collection, boolean required, boolean isMixed, XSComponent source, CCustomizations customizations, Locator locator, boolean dummy, boolean content, boolean isMixedExtended)

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 NClass
getDOMHandler()

Implements org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.getDOMHandler.

If this property supports the wildcard, returns its DOM handler.

public Set<CElement>
getElements()

Implements org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.getElements.

Returns the information about the possible elements in this property.

public MimeType
public QName
public WildcardMode
getWildcard()

Implements org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.getWildcard.

If this property supports the wildcard, returns its mode.

public QName
getXmlName()

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

Deprecated

We'll never use a wrapper element in XJC.

public ID
id()

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

A reference property can never be ID/IDREF because they always point to other element classes.

public boolean
isCollectionNillable()

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

Implements org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.isMixed.

Returns true if this property can hold Strings to represent mixed content model.

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.ReferencePropertyInfo.isRequired.

Returns true if this element is mandatory.

public boolean
isUnboxable()

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

Reference properties refer to elements, and none of the Java primitive type maps to an element.

public PropertyKind
kind()

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

Gets the kind of this property.

public Set<? extends CTypeInfo>
public void
Inherited from com.sun.tools.xjc.model.CPropertyInfo:
displayNamegetCustomizationsgetLocatorgetNamegetNamegetSchemaComponenthasAnnotationinlineBinaryDataisCollectionneedsExplicitTypeNameparentreadAnnotationsetNamesetParent

Field Detail

contentback to summary
private boolean content
dummyback to summary
private boolean dummy
elementsback to summary
private final Set<CElement> elements

List of referenced elements.

isMixedback to summary
private final boolean isMixed
isMixedExtendedCustback to summary
private boolean isMixedExtendedCust
requiredback to summary
private final boolean required

True if this property can never be absent legally.

wildcardback to summary
private WildcardMode wildcard

Constructor Detail

CReferencePropertyInfoback to summary
public CReferencePropertyInfo(String name, boolean collection, boolean required, boolean isMixed, XSComponent source, CCustomizations customizations, Locator locator, boolean dummy, boolean content, boolean isMixedExtended)

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.ReferencePropertyInfo.getAdapter, org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getAdapter.

Annotations
@Override
getDOMHandlerback to summary
public NClass getDOMHandler()

Implements org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.getDOMHandler.

Doc from org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.getDOMHandler.

If this property supports the wildcard, returns its DOM handler.

Annotations
@Override
getElementsback to summary
public Set<CElement> getElements()

Implements org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.getElements.

Doc from org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.getElements.

Returns the information about the possible elements in this property.

As of 2004/08/17, the spec only allows you to use different element names when a property is a collection, but I think there's really no reason to limit it there --- if the user wants to use a different tag name for different objects, I don't see why this can be limited to collections.

So this is a generalization of the spec. We always allow a property to have multiple types and use different tag names for it, depending on the actual type.

In most of the cases, this collection only contains 1 item. So the runtime system is encouraged to provide a faster code-path that is optimized toward such cases.

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
getWildcardback to summary
public WildcardMode getWildcard()

Implements org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.getWildcard.

Doc from org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.getWildcard.

If this property supports the wildcard, returns its mode.

Annotations
@Override
getXmlNameback to summary
public QName getXmlName()

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

Deprecated

We'll never use a wrapper element in XJC. Always return null.

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

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

A reference property can never be ID/IDREF because they always point to other element classes.

Annotations
@Override
isCollectionNillableback to summary
public boolean isCollectionNillable()

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

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

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

Checks if the wrapper element is required.

Annotations
@Override
isContentback to summary
public boolean isContent()
isDummyback to summary
public boolean isDummy()
isMixedback to summary
public boolean isMixed()

Implements org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.isMixed.

Doc from org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.isMixed.

Returns true if this property can hold Strings to represent mixed content model.

Annotations
@Override
isMixedExtendedCustback to summary
public boolean isMixedExtendedCust()
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.ReferencePropertyInfo.isRequired.

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

Returns true if this element is mandatory.

Annotations
@Override
isUnboxableback to summary
public boolean isUnboxable()

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

Reference properties refer to elements, and none of the Java primitive type maps to an element. Thus a reference property is always unboxable.

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 Set<? extends CTypeInfo> ref()

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

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

Doc from org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo.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.. If this has a wildcard in it, then the returned list will contain WildcardTypeInfo.

Annotations
@Override
setWildcardback to summary
public void setWildcard(WildcardMode mode)