Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.model.impl

pack-priv Class ReferencePropertyInfoImpl<T, C, F, M>

extends ERPropertyInfoImpl<T, C, F, M>
implements ReferencePropertyInfo<T, C>, DummyPropertyInfo<T, C, F, M>
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.model.impl.DummyPropertyInfo, org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo, org.glassfish.jaxb.core.v2.model.core.PropertyInfo, org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource
Known Direct Subclasses
org.glassfish.jaxb.runtime.v2.model.impl.RuntimeReferencePropertyInfoImpl
Imports
org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader, org.glassfish.jaxb.core.v2.model.core.*, org.glassfish.jaxb.core.v2.model.nav.Navigator, org.glassfish.jaxb.core.v2.runtime.IllegalAnnotationException, jakarta.xml.bind.JAXBElement, jakarta.xml.bind.annotation.*, javax.xml.namespace.QName, java.util.Collections, .LinkedHashSet, .Set

Implementation of ReferencePropertyInfo.
Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private final C
private static boolean
is2_2

If we find out that we are working with 2.1 API, remember the fact so that we don't waste time generating exceptions every time we call isRequired(XmlElementRef).

private final boolean
private Boolean
isRequired

Lazily computed.

private Set<ReferencePropertyInfoImpl<T, C, F, M>>
private Set<Element<T, C>>
types

Lazily computed.

private final WildcardMode

Constructor Summary

AccessConstructor and Description
public
ReferencePropertyInfoImpl(ClassInfoImpl<T, C, F, M> classInfo, PropertySeed<T, C, F, M> seed)

Method Summary

Modifier and TypeMethod and Description
private boolean
private boolean
addGenericElement(XmlElementRef r)

Returns: true if the reference yields at least one type

private boolean
private boolean
public void
private void
calcTypes(boolean
if true, every XmlElementRef must yield at least one type.
last
)

Compute types.

public final C
getDOMHandler()

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

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

private String
public Set<? extends Element<T, C>>
getElements()

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

Returns the information about the possible elements in this property.

public final WildcardMode
getWildcard()

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

If this property supports the wildcard, returns its mode.

public final 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
isRequired()

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

Returns true if this element is mandatory.

private boolean
isRequired(XmlElementRef ref)

Reads the value of XmlElementRef.required().

public PropertyKind
kind()

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

Gets the kind of this property.

public Set<? extends Element<T, C>>
Inherited from org.glassfish.jaxb.runtime.v2.model.impl.ERPropertyInfoImpl:
getXmlNameisCollectionNillableisCollectionRequired

Field Detail

domHandlerback to summary
private final C domHandler
is2_2back to summary
private static boolean is2_2

If we find out that we are working with 2.1 API, remember the fact so that we don't waste time generating exceptions every time we call isRequired(XmlElementRef).

isMixedback to summary
private final boolean isMixed
isRequiredback to summary
private Boolean isRequired

Lazily computed.

See Also
isRequired()
subTypesback to summary
private Set<ReferencePropertyInfoImpl<T, C, F, M>> subTypes
typesback to summary
private Set<Element<T, C>> types

Lazily computed.

See Also
getElements()
wildcardback to summary
private final WildcardMode wildcard

Constructor Detail

ReferencePropertyInfoImplback to summary
public ReferencePropertyInfoImpl(ClassInfoImpl<T, C, F, M> classInfo, PropertySeed<T, C, F, M> seed)

Method Detail

addAllSubtypesback to summary
private boolean addAllSubtypes(T type)
addGenericElementback to summary
private boolean addGenericElement(XmlElementRef r)
Returns:boolean

true if the reference yields at least one type

addGenericElementback to summary
private boolean addGenericElement(XmlElementRef r, ReferencePropertyInfoImpl<T, C, F, M> info)
addGenericElementback to summary
private boolean addGenericElement(ElementInfo<T, C> ei)
addTypeback to summary
public void addType(PropertyInfo<T, C> info)

Implements org.glassfish.jaxb.runtime.v2.model.impl.DummyPropertyInfo.addType.

Annotations
@Override
@SuppressWarnings:unchecked
calcTypesback to summary
private void calcTypes(boolean last)

Compute types.

Parameters
last:boolean

if true, every XmlElementRef must yield at least one type.

getDOMHandlerback to summary
public final C 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
getEffectiveNamespaceForback to summary
private String getEffectiveNamespaceFor(XmlElementRef r)
getElementsback to summary
public Set<? extends Element<T, C>> 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
getWildcardback to summary
public final 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
isMixedback to summary
public final 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
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
isRequiredback to summary
private boolean isRequired(XmlElementRef ref)

Reads the value of XmlElementRef.required(). If we are working as 2.1 RI, this defaults to true.

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 Element<T, C>> 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