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

java.lang.Object
  extended by com.sun.xml.bind.v2.model.impl.ClassInfoImpl<T,C,F,M>
All Implemented Interfaces:
Locatable, com.sun.xml.bind.v2.model.core.ClassInfo<T,C>, com.sun.xml.bind.v2.model.core.Element<T,C>, com.sun.xml.bind.v2.model.core.MaybeElement<T,C>, com.sun.xml.bind.v2.model.core.NonElement<T,C>, com.sun.xml.bind.v2.model.core.TypeInfo<T,C>

public class ClassInfoImpl<T,C,F,M>
extends Object
implements com.sun.xml.bind.v2.model.core.ClassInfo<T,C>, com.sun.xml.bind.v2.model.core.Element<T,C>

A part of the ClassInfo that doesn't depend on a particular reflection library.

Author:
Kohsuke Kawaguchi (kk@kohsuke.org)

Field Summary
protected  com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> attributeWildcard
          If this class has a declared (not inherited) attribute wildcard, keep the reference to it.
protected  ModelBuilder<TypeT,ClassDeclT,FieldT,MethodT> builder
          Reference to the ModelBuilder, only until we link TypeInfos all together, because we don't want to keep ModelBuilder too long.
protected  C clazz
           
protected  com.sun.xml.bind.v2.model.impl.TypeInfoSetImpl<TypeT,ClassDeclT,FieldT,MethodT> owner
          TypeInfoSet to which this class belongs.
 
Fields inherited from interface com.sun.xml.bind.v2.model.core.NonElement
ANYTYPE_NAME
 
Method Summary
 com.sun.xml.bind.v2.model.core.Element<T,C> asElement()
           
 boolean canBeReferencedByIDREF()
          A ClassInfo can be referenced by XmlIDREF if it has an ID property.
protected  void checkFieldXmlLocation(F f)
          This hook is used by RuntimeClassInfoImpl to look for XmlLocation.
protected  com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> createAccessorSeed(M getter, M setter)
          Creates a new GetterSetterPropertySeed object.
protected  com.sun.xml.bind.v2.model.impl.AttributePropertyInfoImpl<T,C,F,M> createAttributeProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)
           
protected  com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl<T,C,F,M> createElementProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)
           
protected  com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> createFieldSeed(F f)
          Creates a new FieldPropertySeed object.
protected  com.sun.xml.bind.v2.model.impl.MapPropertyInfoImpl<T,C,F,M> createMapProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)
           
protected  com.sun.xml.bind.v2.model.impl.ReferencePropertyInfoImpl<T,C,F,M> createReferenceProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)
           
protected  com.sun.xml.bind.v2.model.impl.ValuePropertyInfoImpl<T,C,F,M> createValueProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)
           
 boolean declaresAttributeWildcard()
           
 ClassInfoImpl<T,C,F,M> getBaseClass()
           
 C getClazz()
           
 QName getElementName()
           
 Method getFactoryMethod()
           
 Location getLocation()
           
 String getName()
           
 List<? extends com.sun.xml.bind.v2.model.core.PropertyInfo<T,C>> getProperties()
           
 com.sun.xml.bind.v2.model.core.PropertyInfo<T,C> getProperty(String name)
           
 ClassInfoImpl<T,C,F,M> getScope()
          Deprecated. you shouldn't be invoking this method on ClassInfoImpl.
 com.sun.xml.bind.v2.model.core.Element<T,C> getSubstitutionHead()
           The substitution hierarchy is the same as the inheritance hierarchy.
 T getType()
           
 QName getTypeName()
           
 Locatable getUpstream()
           
 boolean hasAttributeWildcard()
           
 boolean hasProperties()
           
 boolean hasSubClasses()
           
 boolean hasValueProperty()
           
 boolean inheritsAttributeWildcard()
           
 boolean isAbstract()
           
 boolean isElement()
           
 boolean isFinal()
           
 boolean isOrdered()
           
 boolean isSimpleType()
           
protected  com.sun.xml.bind.v2.model.nav.Navigator<TypeT,ClassDeclT,FieldT,MethodT> nav()
           
protected  QName parseElementName(ClassDeclT clazz)
          Parses an XmlRootElement annotation on a class and determine the element name.
protected  QName parseTypeName(ClassDeclT clazz)
           
protected  QName parseTypeName(ClassDeclT clazz, XmlType t)
          Parses a (potentially-null) XmlType annotation on a class and determine the actual value.
<A extends Annotation>
A
readAnnotation(Class<A> a)
           
protected  AnnotationReader<TypeT,ClassDeclT,FieldT,MethodT> reader()
           
 String toString()
           
 
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.annotation.Locatable
getUpstream
 

Field Detail

clazz

protected final C clazz

attributeWildcard

protected com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> attributeWildcard
If this class has a declared (not inherited) attribute wildcard, keep the reference to it. This parameter is initialized at the construction time and never change.


owner

protected final com.sun.xml.bind.v2.model.impl.TypeInfoSetImpl<TypeT,ClassDeclT,FieldT,MethodT> owner
TypeInfoSet to which this class belongs.


builder

protected ModelBuilder<TypeT,ClassDeclT,FieldT,MethodT> builder
Reference to the ModelBuilder, only until we link TypeInfos all together, because we don't want to keep ModelBuilder too long.

Method Detail

getBaseClass

public ClassInfoImpl<T,C,F,M> getBaseClass()
Specified by:
getBaseClass in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

getSubstitutionHead

public final com.sun.xml.bind.v2.model.core.Element<T,C> getSubstitutionHead()
The substitution hierarchy is the same as the inheritance hierarchy.

Specified by:
getSubstitutionHead in interface com.sun.xml.bind.v2.model.core.Element<T,C>

getClazz

public final C getClazz()
Specified by:
getClazz in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

getScope

public ClassInfoImpl<T,C,F,M> getScope()
Deprecated. you shouldn't be invoking this method on ClassInfoImpl.

When a bean binds to an element, it's always through XmlRootElement, so this method always return null.

Specified by:
getScope in interface com.sun.xml.bind.v2.model.core.Element<T,C>

getType

public final T getType()
Specified by:
getType in interface com.sun.xml.bind.v2.model.core.TypeInfo<T,C>

canBeReferencedByIDREF

public boolean canBeReferencedByIDREF()
A ClassInfo can be referenced by XmlIDREF if it has an ID property.

Specified by:
canBeReferencedByIDREF in interface com.sun.xml.bind.v2.model.core.TypeInfo<T,C>

getName

public final String getName()
Specified by:
getName in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

readAnnotation

public <A extends Annotation> A readAnnotation(Class<A> a)

asElement

public com.sun.xml.bind.v2.model.core.Element<T,C> asElement()
Specified by:
asElement in interface com.sun.xml.bind.v2.model.core.MaybeElement<T,C>

getProperties

public List<? extends com.sun.xml.bind.v2.model.core.PropertyInfo<T,C>> getProperties()
Specified by:
getProperties in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

hasValueProperty

public final boolean hasValueProperty()
Specified by:
hasValueProperty in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

getProperty

public com.sun.xml.bind.v2.model.core.PropertyInfo<T,C> getProperty(String name)
Specified by:
getProperty in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

checkFieldXmlLocation

protected void checkFieldXmlLocation(F f)
This hook is used by RuntimeClassInfoImpl to look for XmlLocation.


hasProperties

public boolean hasProperties()
Specified by:
hasProperties in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

createReferenceProperty

protected com.sun.xml.bind.v2.model.impl.ReferencePropertyInfoImpl<T,C,F,M> createReferenceProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)

createAttributeProperty

protected com.sun.xml.bind.v2.model.impl.AttributePropertyInfoImpl<T,C,F,M> createAttributeProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)

createValueProperty

protected com.sun.xml.bind.v2.model.impl.ValuePropertyInfoImpl<T,C,F,M> createValueProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)

createElementProperty

protected com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl<T,C,F,M> createElementProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)

createMapProperty

protected com.sun.xml.bind.v2.model.impl.MapPropertyInfoImpl<T,C,F,M> createMapProperty(com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> seed)

createFieldSeed

protected com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> createFieldSeed(F f)
Creates a new FieldPropertySeed object.

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


createAccessorSeed

protected com.sun.xml.bind.v2.model.impl.PropertySeed<T,C,F,M> createAccessorSeed(M getter,
                                                                                  M setter)
Creates a new GetterSetterPropertySeed object.


isElement

public final boolean isElement()
Specified by:
isElement in interface com.sun.xml.bind.v2.model.core.MaybeElement<T,C>

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

isOrdered

public boolean isOrdered()
Specified by:
isOrdered in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

isFinal

public final boolean isFinal()
Specified by:
isFinal in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

hasSubClasses

public final boolean hasSubClasses()
Specified by:
hasSubClasses in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

hasAttributeWildcard

public final boolean hasAttributeWildcard()
Specified by:
hasAttributeWildcard in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

inheritsAttributeWildcard

public final boolean inheritsAttributeWildcard()
Specified by:
inheritsAttributeWildcard in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

declaresAttributeWildcard

public final boolean declaresAttributeWildcard()
Specified by:
declaresAttributeWildcard in interface com.sun.xml.bind.v2.model.core.ClassInfo<T,C>

getElementName

public final QName getElementName()
Specified by:
getElementName in interface com.sun.xml.bind.v2.model.core.Element<T,C>
Specified by:
getElementName in interface com.sun.xml.bind.v2.model.core.MaybeElement<T,C>

getTypeName

public final QName getTypeName()
Specified by:
getTypeName in interface com.sun.xml.bind.v2.model.core.NonElement<T,C>

isSimpleType

public final boolean isSimpleType()
Specified by:
isSimpleType in interface com.sun.xml.bind.v2.model.core.NonElement<T,C>

getLocation

public Location getLocation()
Specified by:
getLocation in interface Locatable

getFactoryMethod

public Method getFactoryMethod()

toString

public String toString()
Overrides:
toString in class Object

getUpstream

public Locatable getUpstream()
Specified by:
getUpstream in interface Locatable

nav

protected final com.sun.xml.bind.v2.model.nav.Navigator<TypeT,ClassDeclT,FieldT,MethodT> nav()

reader

protected final AnnotationReader<TypeT,ClassDeclT,FieldT,MethodT> reader()

parseElementName

protected final QName parseElementName(ClassDeclT clazz)
Parses an XmlRootElement annotation on a class and determine the element name.

Returns:
null if none was found.

parseTypeName

protected final QName parseTypeName(ClassDeclT clazz)

parseTypeName

protected final QName parseTypeName(ClassDeclT clazz,
                                    XmlType t)
Parses a (potentially-null) XmlType annotation on a class and determine the actual value.

Parameters:
clazz - The class on which the XmlType annotation is checked.
t - The XmlType annotation on the clazz. This value is taken as a parameter to improve the performance for the case where 't' is pre-computed.


Copyright © 2014 Oracle Corporation. All Rights Reserved.