Module com.sun.xml.bind
Class ClassInfoImpl<T,C,F,M>
- java.lang.Object
-
- org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl<T,C,F,M>
-
- All Implemented Interfaces:
Locatable
,ClassInfo<T,C>
,Element<T,C>
,MaybeElement<T,C>
,NonElement<T,C>
,TypeInfo<T,C>
public class ClassInfoImpl<T,C,F,M> extends Object implements ClassInfo<T,C>, Element<T,C>
A part of theClassInfo
that doesn't depend on a particular reflection library.- Author:
- Kohsuke Kawaguchi ([email protected])
-
-
Field Summary
Fields Modifier and Type Field Description protected 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 theModelBuilder
, only until we linkTypeInfo
s all together, because we don't want to keepModelBuilder
too long.protected C
clazz
protected org.glassfish.jaxb.runtime.v2.model.impl.TypeInfoSetImpl<TypeT,ClassDeclT,FieldT,MethodT>
owner
TypeInfoSet
to which this class belongs.-
Fields inherited from interface org.glassfish.jaxb.core.v2.model.core.NonElement
ANYTYPE_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Element<T,C>
asElement()
boolean
canBeReferencedByIDREF()
AClassInfo
can be referenced byXmlIDREF
if it has an ID property.protected void
checkFieldXmlLocation(F f)
This hook is used byRuntimeClassInfoImpl
to look forXmlLocation
.protected PropertySeed<T,C,F,M>
createAccessorSeed(M getter, M setter)
Creates a newGetterSetterPropertySeed
object.protected AttributePropertyInfo<T,C>
createAttributeProperty(PropertySeed<T,C,F,M> seed)
protected ElementPropertyInfo<T,C>
createElementProperty(PropertySeed<T,C,F,M> seed)
protected PropertySeed<T,C,F,M>
createFieldSeed(F f)
Creates a newFieldPropertySeed
object.protected MapPropertyInfo<T,C>
createMapProperty(PropertySeed<T,C,F,M> seed)
protected ReferencePropertyInfo<T,C>
createReferenceProperty(PropertySeed<T,C,F,M> seed)
protected ValuePropertyInfo<T,C>
createValueProperty(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 PropertyInfo<T,C>>
getProperties()
PropertyInfo<T,C>
getProperty(String name)
ClassInfoImpl<T,C,F,M>
getScope()
Deprecated.you shouldn't be invoking this method on .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 Navigator<TypeT,ClassDeclT,FieldT,MethodT>
nav()
protected QName
parseElementName(ClassDeclT clazz)
Parses anXmlRootElement
annotation on a class and determine the element name.protected QName
parseTypeName(ClassDeclT clazz)
protected QName
parseTypeName(ClassDeclT clazz, jakarta.xml.bind.annotation.XmlType t)
Parses a (potentially-null)XmlType
annotation on a class and determine the actual value.<A extends Annotation>
AreadAnnotation(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 org.glassfish.jaxb.core.v2.model.annotation.Locatable
getUpstream
-
-
-
-
Field Detail
-
clazz
protected final C clazz
-
attributeWildcard
protected 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 org.glassfish.jaxb.runtime.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 theModelBuilder
, only until we linkTypeInfo
s all together, because we don't want to keepModelBuilder
too long.
-
-
Method Detail
-
getBaseClass
public ClassInfoImpl<T,C,F,M> getBaseClass()
- Specified by:
getBaseClass
in interfaceClassInfo<T,C>
-
getSubstitutionHead
public final Element<T,C> getSubstitutionHead()
The substitution hierarchy is the same as the inheritance hierarchy.- Specified by:
getSubstitutionHead
in interfaceElement<T,C>
-
getScope
@Deprecated public ClassInfoImpl<T,C,F,M> getScope()
Deprecated.you shouldn't be invoking this method on .When a bean binds to an element, it's always throughXmlRootElement
, so this method always return null.
-
canBeReferencedByIDREF
public boolean canBeReferencedByIDREF()
AClassInfo
can be referenced byXmlIDREF
if it has an ID property.- Specified by:
canBeReferencedByIDREF
in interfaceTypeInfo<T,C>
-
readAnnotation
public <A extends Annotation> A readAnnotation(Class<A> a)
-
getProperties
public List<? extends PropertyInfo<T,C>> getProperties()
- Specified by:
getProperties
in interfaceClassInfo<T,C>
-
hasValueProperty
public final boolean hasValueProperty()
- Specified by:
hasValueProperty
in interfaceClassInfo<T,C>
-
getProperty
public PropertyInfo<T,C> getProperty(String name)
- Specified by:
getProperty
in interfaceClassInfo<T,C>
-
checkFieldXmlLocation
protected void checkFieldXmlLocation(F f)
This hook is used byRuntimeClassInfoImpl
to look forXmlLocation
.
-
hasProperties
public boolean hasProperties()
- Specified by:
hasProperties
in interfaceClassInfo<T,C>
-
createReferenceProperty
protected ReferencePropertyInfo<T,C> createReferenceProperty(PropertySeed<T,C,F,M> seed)
-
createAttributeProperty
protected AttributePropertyInfo<T,C> createAttributeProperty(PropertySeed<T,C,F,M> seed)
-
createValueProperty
protected ValuePropertyInfo<T,C> createValueProperty(PropertySeed<T,C,F,M> seed)
-
createElementProperty
protected ElementPropertyInfo<T,C> createElementProperty(PropertySeed<T,C,F,M> seed)
-
createMapProperty
protected MapPropertyInfo<T,C> createMapProperty(PropertySeed<T,C,F,M> seed)
-
createFieldSeed
protected PropertySeed<T,C,F,M> createFieldSeed(F f)
Creates a newFieldPropertySeed
object.Derived class can override this method to create a sub-class.
-
createAccessorSeed
protected PropertySeed<T,C,F,M> createAccessorSeed(M getter, M setter)
Creates a newGetterSetterPropertySeed
object.
-
isElement
public final boolean isElement()
- Specified by:
isElement
in interfaceMaybeElement<T,C>
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceClassInfo<T,C>
-
hasSubClasses
public final boolean hasSubClasses()
- Specified by:
hasSubClasses
in interfaceClassInfo<T,C>
-
hasAttributeWildcard
public final boolean hasAttributeWildcard()
- Specified by:
hasAttributeWildcard
in interfaceClassInfo<T,C>
-
inheritsAttributeWildcard
public final boolean inheritsAttributeWildcard()
- Specified by:
inheritsAttributeWildcard
in interfaceClassInfo<T,C>
-
declaresAttributeWildcard
public final boolean declaresAttributeWildcard()
- Specified by:
declaresAttributeWildcard
in interfaceClassInfo<T,C>
-
getElementName
public final QName getElementName()
- Specified by:
getElementName
in interfaceElement<T,C>
- Specified by:
getElementName
in interfaceMaybeElement<T,C>
-
getTypeName
public final QName getTypeName()
- Specified by:
getTypeName
in interfaceNonElement<T,C>
-
isSimpleType
public final boolean isSimpleType()
- Specified by:
isSimpleType
in interfaceNonElement<T,C>
-
getLocation
public Location getLocation()
- Specified by:
getLocation
in interfaceLocatable
-
getFactoryMethod
public Method getFactoryMethod()
-
getUpstream
public Locatable getUpstream()
- Specified by:
getUpstream
in interfaceLocatable
-
nav
protected final Navigator<TypeT,ClassDeclT,FieldT,MethodT> nav()
-
reader
protected final AnnotationReader<TypeT,ClassDeclT,FieldT,MethodT> reader()
-
parseElementName
protected final QName parseElementName(ClassDeclT clazz)
Parses anXmlRootElement
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, jakarta.xml.bind.annotation.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
- TheXmlType
annotation on the clazz. This value is taken as a parameter to improve the performance for the case where 't' is pre-computed.
-
-