com.sun.xml.bind.v2.model.impl
Class ReferencePropertyInfoImpl<T,C,F,M>

java.lang.Object
  extended by com.sun.xml.bind.v2.model.impl.PropertyInfoImpl<TypeT,ClassDeclT,FieldT,MethodT>
      extended by com.sun.xml.bind.v2.model.impl.ERPropertyInfoImpl<T,C,F,M>
          extended by com.sun.xml.bind.v2.model.impl.ReferencePropertyInfoImpl<T,C,F,M>
All Implemented Interfaces:
Locatable, PropertyInfo<T,C>, ReferencePropertyInfo<T,C>, java.lang.Comparable<PropertyInfoImpl>
Direct Known Subclasses:
RuntimeReferencePropertyInfoImpl

 class ReferencePropertyInfoImpl<T,C,F,M>
extends ERPropertyInfoImpl<T,C,F,M>
implements ReferencePropertyInfo<T,C>

Implementation of ReferencePropertyInfo.


Field Summary
 
Fields inherited from class com.sun.xml.bind.v2.model.impl.PropertyInfoImpl
parent, seed
 
Constructor Summary
ReferencePropertyInfoImpl(ClassInfoImpl<T,C,F,M> classInfo, PropertySeed<T,C,F,M> seed)
           
 
Method Summary
 C getDOMHandler()
          If this property supports the wildcard, returns its DOM handler.
 java.util.Set<? extends Element<T,C>> getElements()
          Returns the information about the possible elements in this property.
 WildcardMode getWildcard()
          If this property supports the wildcard, returns its mode.
 boolean isMixed()
          Returns true if this property can hold Strings to represent mixed content model.
 PropertyKind kind()
          Gets the kind of this proeprty.
protected  void link()
          Called after all the TypeInfos are collected into the governing TypeInfoSet.
 java.util.Set<? extends Element<T,C>> ref()
          List of TypeInfos that this property references.
 
Methods inherited from class com.sun.xml.bind.v2.model.impl.ERPropertyInfoImpl
getXmlName, isCollectionNillable
 
Methods inherited from class com.sun.xml.bind.v2.model.impl.PropertyInfoImpl
calcXmlName, calcXmlName, compareTo, displayName, getAdapter, getExpectedMimeType, getIndividualType, getLocation, getName, getRawType, getSchemaType, getUpstream, id, inlineBinaryData, isCollection, nav, parent, reader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.ReferencePropertyInfo
getAdapter, getXmlName, isCollectionNillable
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.PropertyInfo
displayName, getExpectedMimeType, getName, getSchemaType, id, inlineBinaryData, isCollection, parent
 

Constructor Detail

ReferencePropertyInfoImpl

public ReferencePropertyInfoImpl(ClassInfoImpl<T,C,F,M> classInfo,
                                 PropertySeed<T,C,F,M> seed)
Method Detail

ref

public java.util.Set<? extends Element<T,C>> ref()
Description copied from interface: PropertyInfo
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.

Specified by:
ref in interface PropertyInfo<T,C>
Specified by:
ref in interface ReferencePropertyInfo<T,C>
Returns:
non-null read-only collection.

kind

public PropertyKind kind()
Description copied from interface: PropertyInfo
Gets the kind of this proeprty.

Specified by:
kind in interface PropertyInfo<T,C>
Returns:
always non-null.

getElements

public java.util.Set<? extends Element<T,C>> getElements()
Description copied from interface: ReferencePropertyInfo
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.

Specified by:
getElements in interface ReferencePropertyInfo<T,C>
Returns:
Always non-null. Contains at least one entry.

link

protected void link()
Description copied from class: PropertyInfoImpl
Called after all the TypeInfos are collected into the governing TypeInfoSet. Derived class can do additional actions to complete the model.

Overrides:
link in class PropertyInfoImpl<T,C,F,M>

isMixed

public final boolean isMixed()
Description copied from interface: ReferencePropertyInfo
Returns true if this property can hold Strings to represent mixed content model.

Specified by:
isMixed in interface ReferencePropertyInfo<T,C>

getWildcard

public final WildcardMode getWildcard()
Description copied from interface: ReferencePropertyInfo
If this property supports the wildcard, returns its mode.

Specified by:
getWildcard in interface ReferencePropertyInfo<T,C>
Returns:
null if the wildcard is not allowed on this element.

getDOMHandler

public final C getDOMHandler()
Description copied from interface: ReferencePropertyInfo
If this property supports the wildcard, returns its DOM handler.

Specified by:
getDOMHandler in interface ReferencePropertyInfo<T,C>
Returns:
null if the wildcard is not allowed on this element.