com.sun.xml.bind.v2.model.impl
Class RuntimeClassInfoImpl

java.lang.Object
  extended by com.sun.xml.bind.v2.model.impl.TypeInfoImpl<T,C,F,M>
      extended by com.sun.xml.bind.v2.model.impl.ClassInfoImpl<Type,Class,Field,Method>
          extended by com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl
All Implemented Interfaces:
Locatable, ClassInfo<Type,Class>, Element<Type,Class>, MaybeElement<Type,Class>, NonElement<Type,Class>, TypeInfo<Type,Class>, RuntimeClassInfo, RuntimeElement, RuntimeNonElement, RuntimeTypeInfo

 class RuntimeClassInfoImpl
extends ClassInfoImpl<Type,Class,Field,Method>
implements RuntimeClassInfo, RuntimeElement


Nested Class Summary
(package private) static class RuntimeClassInfoImpl.RuntimePropertySeed
           
 
Field Summary
 
Fields inherited from class com.sun.xml.bind.v2.model.impl.ClassInfoImpl
attributeWildcard, clazz
 
Fields inherited from class com.sun.xml.bind.v2.model.impl.TypeInfoImpl
builder, owner
 
Fields inherited from interface com.sun.xml.bind.v2.model.core.NonElement
ANYTYPE_NAME
 
Constructor Summary
RuntimeClassInfoImpl(RuntimeModelBuilder modelBuilder, Locatable upstream, Class clazz)
           
 
Method Summary
protected  void checkFieldXmlLocation(Field f)
          This hook is used by RuntimeClassInfoImpl to look for XmlLocation.
protected  AccessorFactory createAccessorFactory(Class clazz)
           
 RuntimeClassInfoImpl.RuntimePropertySeed createAccessorSeed(Method getter, Method setter)
          Creates a new GetterSetterPropertySeed object.
protected  AttributePropertyInfoImpl createAttributeProperty(PropertySeed<Type,Class,Field,Method> seed)
           
protected  ElementPropertyInfoImpl createElementProperty(PropertySeed<Type,Class,Field,Method> seed)
           
protected  RuntimeClassInfoImpl.RuntimePropertySeed createFieldSeed(Field field)
          Creates a new FieldPropertySeed object.
protected  MapPropertyInfoImpl createMapProperty(PropertySeed<Type,Class,Field,Method> seed)
           
protected  ReferencePropertyInfoImpl createReferenceProperty(PropertySeed<Type,Class,Field,Method> seed)
           
protected  ValuePropertyInfoImpl createValueProperty(PropertySeed<Type,Class,Field,Method> seed)
           
protected  XmlAccessorFactory findXmlAccessorFactoryAnnotation(Class clazz)
           
<B> Accessor<B,Map<QName,String>>
getAttributeWildcard()
          If ClassInfo.hasAttributeWildcard() is true, returns the accessor to access the property.
 RuntimeClassInfoImpl getBaseClass()
          Obtains the information about the base class.
 Method getFactoryMethod()
           
 Accessor<?,Locator> getLocatorField()
          If this JAXB bean has a property annotated with XmlLocation, this method returns it.
 List<? extends RuntimePropertyInfo> getProperties()
          Returns all the properties newly declared in this class.
 RuntimePropertyInfo getProperty(String name)
          Gets the property that has the specified name.
 Transducer getTransducer()
          This method doesn't take the reference properties defined on RuntimeNonElementRef into account (such as ID-ness.)
 void link()
          Called after all the TypeInfos are collected into the TypeInfoImpl.owner.
 
Methods inherited from class com.sun.xml.bind.v2.model.impl.ClassInfoImpl
asElement, canBeReferencedByIDREF, declaresAttributeWildcard, getClazz, getElementName, getLocation, getName, getScope, getSubstitutionHead, getType, getTypeName, hasAttributeWildcard, hasProperties, hasSubClasses, hasValueProperty, inheritsAttributeWildcard, isAbstract, isElement, isFinal, isOrdered, isSimpleType, readAnnotation, toString
 
Methods inherited from class com.sun.xml.bind.v2.model.impl.TypeInfoImpl
getUpstream, nav, parseElementName, parseTypeName, parseTypeName, reader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.ClassInfo
declaresAttributeWildcard, getClazz, getName, hasAttributeWildcard, hasProperties, hasSubClasses, hasValueProperty, inheritsAttributeWildcard, isAbstract, isFinal, isOrdered
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.MaybeElement
asElement, getElementName, isElement
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.NonElement
getTypeName, isSimpleType
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.TypeInfo
canBeReferencedByIDREF, getType
 
Methods inherited from interface com.sun.xml.bind.v2.model.annotation.Locatable
getLocation, getUpstream
 
Methods inherited from interface com.sun.xml.bind.v2.model.core.Element
getElementName, getScope, getSubstitutionHead
 

Constructor Detail

RuntimeClassInfoImpl

public RuntimeClassInfoImpl(RuntimeModelBuilder modelBuilder,
                            Locatable upstream,
                            Class clazz)
Method Detail

createAccessorFactory

protected AccessorFactory createAccessorFactory(Class clazz)

findXmlAccessorFactoryAnnotation

protected XmlAccessorFactory findXmlAccessorFactoryAnnotation(Class clazz)

getFactoryMethod

public Method getFactoryMethod()
Specified by:
getFactoryMethod in interface RuntimeClassInfo
Overrides:
getFactoryMethod in class ClassInfoImpl<Type,Class,Field,Method>

getBaseClass

public final RuntimeClassInfoImpl getBaseClass()
Description copied from interface: ClassInfo
Obtains the information about the base class.

Specified by:
getBaseClass in interface ClassInfo<Type,Class>
Specified by:
getBaseClass in interface RuntimeClassInfo
Overrides:
getBaseClass in class ClassInfoImpl<Type,Class,Field,Method>
Returns:
null if this info extends from Object.

createReferenceProperty

protected ReferencePropertyInfoImpl createReferenceProperty(PropertySeed<Type,Class,Field,Method> seed)
Overrides:
createReferenceProperty in class ClassInfoImpl<Type,Class,Field,Method>

createAttributeProperty

protected AttributePropertyInfoImpl createAttributeProperty(PropertySeed<Type,Class,Field,Method> seed)
Overrides:
createAttributeProperty in class ClassInfoImpl<Type,Class,Field,Method>

createValueProperty

protected ValuePropertyInfoImpl createValueProperty(PropertySeed<Type,Class,Field,Method> seed)
Overrides:
createValueProperty in class ClassInfoImpl<Type,Class,Field,Method>

createElementProperty

protected ElementPropertyInfoImpl createElementProperty(PropertySeed<Type,Class,Field,Method> seed)
Overrides:
createElementProperty in class ClassInfoImpl<Type,Class,Field,Method>

createMapProperty

protected MapPropertyInfoImpl createMapProperty(PropertySeed<Type,Class,Field,Method> seed)
Overrides:
createMapProperty in class ClassInfoImpl<Type,Class,Field,Method>

getProperties

public List<? extends RuntimePropertyInfo> getProperties()
Description copied from interface: ClassInfo
Returns all the properties newly declared in this class.

This excludes properties defined in the super class.

If the properties are ordered, it will be returned in the order that appear in XML. Otherwise it will be returned in no particular order.

Properties marked with XmlTransient will not show up in this list. As far as JAXB is concerned, they are considered non-existent.

Specified by:
getProperties in interface ClassInfo<Type,Class>
Specified by:
getProperties in interface RuntimeClassInfo
Overrides:
getProperties in class ClassInfoImpl<Type,Class,Field,Method>
Returns:
always non-null, but can be empty.

getProperty

public RuntimePropertyInfo getProperty(String name)
Description copied from interface: ClassInfo
Gets the property that has the specified name.

This is just a convenience method for:

 for( PropertyInfo p : getProperties() ) {
   if(p.getName().equals(name))
     return p;
 }
 return null;
 

Specified by:
getProperty in interface ClassInfo<Type,Class>
Specified by:
getProperty in interface RuntimeClassInfo
Overrides:
getProperty in class ClassInfoImpl<Type,Class,Field,Method>
Returns:
null if the property was not found.
See Also:
PropertyInfo.getName()

link

public void link()
Description copied from class: ClassInfoImpl
Called after all the TypeInfos are collected into the TypeInfoImpl.owner.

Overrides:
link in class ClassInfoImpl<Type,Class,Field,Method>

getAttributeWildcard

public <B> Accessor<B,Map<QName,String>> getAttributeWildcard()
Description copied from interface: RuntimeClassInfo
If ClassInfo.hasAttributeWildcard() is true, returns the accessor to access the property.

Specified by:
getAttributeWildcard in interface RuntimeClassInfo
Returns:
unoptimized accessor. non-null iff ClassInfo.hasAttributeWildcard()==true.
See Also:
Accessor#optimize()

getTransducer

public Transducer getTransducer()
Description copied from interface: RuntimeNonElement
This method doesn't take the reference properties defined on RuntimeNonElementRef into account (such as ID-ness.)

Specified by:
getTransducer in interface RuntimeNonElement
See Also:
RuntimeNonElementRef.getTransducer()

createFieldSeed

protected RuntimeClassInfoImpl.RuntimePropertySeed createFieldSeed(Field field)
Description copied from class: ClassInfoImpl
Creates a new FieldPropertySeed object.

Derived class can override this method to create a sub-class.

Overrides:
createFieldSeed in class ClassInfoImpl<Type,Class,Field,Method>

createAccessorSeed

public RuntimeClassInfoImpl.RuntimePropertySeed createAccessorSeed(Method getter,
                                                                   Method setter)
Description copied from class: ClassInfoImpl
Creates a new GetterSetterPropertySeed object.

Overrides:
createAccessorSeed in class ClassInfoImpl<Type,Class,Field,Method>

checkFieldXmlLocation

protected void checkFieldXmlLocation(Field f)
Description copied from class: ClassInfoImpl
This hook is used by RuntimeClassInfoImpl to look for XmlLocation.

Overrides:
checkFieldXmlLocation in class ClassInfoImpl<Type,Class,Field,Method>

getLocatorField

public Accessor<?,Locator> getLocatorField()
Description copied from interface: RuntimeClassInfo
If this JAXB bean has a property annotated with XmlLocation, this method returns it.

Specified by:
getLocatorField in interface RuntimeClassInfo
Returns:
may be null.