Class ClassInfoImpl<T,C,F,M>
- All Implemented Interfaces:
Locatable
,ClassInfo<T,
,C> Element<T,
,C> MaybeElement<T,
,C> NonElement<T,
,C> TypeInfo<T,
C>
ClassInfo
that doesn't depend on a particular
reflection library.- Author:
- Kohsuke Kawaguchi (kk@kohsuke.org)
-
Field Summary
FieldsModifier and TypeFieldDescriptionIf this class has a declared (not inherited) attribute wildcard, keep the reference to it.protected ModelBuilder<T,
C, F, M> Reference to theModelBuilder
, only until we linkTypeInfo
s all together, because we don't want to keepModelBuilder
too long.protected final C
TypeInfoSet
to which this class belongs.Fields inherited from interface com.sun.xml.bind.v2.model.core.NonElement
ANYTYPE_NAME
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected void
This hook is used byRuntimeClassInfoImpl
to look forXmlLocation
.createAccessorSeed
(M getter, M setter) Creates a newGetterSetterPropertySeed
object.createAttributeProperty
(com.sun.xml.bind.v2.model.impl.PropertySeed<T, C, F, M> seed) createElementProperty
(com.sun.xml.bind.v2.model.impl.PropertySeed<T, C, F, M> seed) createFieldSeed
(F f) Creates a newFieldPropertySeed
object.createMapProperty
(com.sun.xml.bind.v2.model.impl.PropertySeed<T, C, F, M> seed) createReferenceProperty
(com.sun.xml.bind.v2.model.impl.PropertySeed<T, C, F, M> seed) createValueProperty
(com.sun.xml.bind.v2.model.impl.PropertySeed<T, C, F, M> seed) final boolean
Returns true iff this class declares a wildcard attribute.ClassInfoImpl<T,
C, F, M> Obtains the information about the base class.final C
getClazz()
Gets the declaration this object is wrapping.final QName
Gets the element name of the class, if the class is bound to an element.Gets the location object that this object points to.final String
getName()
Gets the fully-qualified name of the class.List<? extends PropertyInfo<T,
C>> Returns all the properties newly declared in this class.getProperty
(String name) Gets the property that has the specified name.ClassInfoImpl<T,
C, F, M> getScope()
Deprecated.If this element can substitute another element, return that element.final T
getType()
Gets the underlying Java type that object represents.final QName
Gets the primary XML type ANYTYPE_NAME of the class.Gets the upstreamLocation
information.final boolean
Returns true if this bean class has an attribute wildcard.boolean
If the class has properties, return true.final boolean
True if there's a known sub-type of this class inTypeInfoSet
.final boolean
Returns true if this class or its ancestor hasXmlValue
property.final boolean
Returns true iff this class inherits a wildcard attribute from its ancestor classes.boolean
If this class is abstract and thus shall never be directly instanciated.final boolean
If the class is bound to an element, return true.final boolean
isFinal()
If this class is marked as final and no further extension/restriction is allowed.boolean
Returns true if the properties of this class is ordered in XML.final boolean
Returns true if thisNonElement
maps to text in XML, without any attribute nor child elements.nav()
protected final QName
parseElementName
(C clazz) Parses anXmlRootElement
annotation on a class and determine the element name.protected final QName
parseTypeName
(C clazz) protected final QName
parseTypeName
(C clazz, XmlType t) Parses a (potentially-null)XmlType
annotation on a class and determine the actual value.<A extends Annotation>
AreadAnnotation
(Class<A> a) protected final AnnotationReader<T,
C, F, M> reader()
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 Details
-
clazz
-
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
TypeInfoSet
to which this class belongs. -
builder
Reference to theModelBuilder
, only until we linkTypeInfo
s all together, because we don't want to keepModelBuilder
too long.
-
-
Method Details
-
getBaseClass
Description copied from interface:ClassInfo
Obtains the information about the base class.- Specified by:
getBaseClass
in interfaceClassInfo<T,
C> - Returns:
- null
if this info extends from
Object
.
-
getSubstitutionHead
If this element can substitute another element, return that element.Substitutability of elements are transitive. The substitution hierarchy is the same as the inheritance hierarchy.
- Specified by:
getSubstitutionHead
in interfaceElement<T,
C> - Returns:
- null if no such element exists.
-
getClazz
Description copied from interface:ClassInfo
Gets the declaration this object is wrapping. -
getScope
Deprecated.you shouldn't be invoking this method onClassInfoImpl
.When a bean binds to an element, it's always throughXmlRootElement
, so this method always return null. -
getType
Description copied from interface:TypeInfo
Gets the underlying Java type that object represents. -
canBeReferencedByIDREF
public boolean canBeReferencedByIDREF()- Specified by:
canBeReferencedByIDREF
in interfaceTypeInfo<T,
C>
-
getName
Description copied from interface:ClassInfo
Gets the fully-qualified name of the class. -
readAnnotation
-
asElement
Description copied from interface:MaybeElement
- Specified by:
asElement
in interfaceMaybeElement<T,
C> - Returns:
- null if
MaybeElement.isElement()
==false, non-null ifMaybeElement.isElement()
==true.
-
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 interfaceClassInfo<T,
C> - Returns:
- always non-null, but can be empty.
-
hasValueProperty
public final boolean hasValueProperty()Description copied from interface:ClassInfo
Returns true if this class or its ancestor hasXmlValue
property.- Specified by:
hasValueProperty
in interfaceClassInfo<T,
C>
-
getProperty
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 interfaceClassInfo<T,
C> - Returns:
- null if the property was not found.
- See Also:
-
checkFieldXmlLocation
This hook is used byRuntimeClassInfoImpl
to look forXmlLocation
. -
hasProperties
public boolean hasProperties()Description copied from interface:ClassInfo
If the class has properties, return true. This is only true if the Collection object returned byClassInfo.getProperties()
is not empty.- Specified by:
hasProperties
in interfaceClassInfo<T,
C>
-
createReferenceProperty
-
createAttributeProperty
-
createValueProperty
-
createElementProperty
-
createMapProperty
-
createFieldSeed
Creates a newFieldPropertySeed
object.Derived class can override this method to create a sub-class.
-
createAccessorSeed
protected com.sun.xml.bind.v2.model.impl.PropertySeed<T,C, createAccessorSeedF, M> (M getter, M setter) Creates a newGetterSetterPropertySeed
object. -
isElement
public final boolean isElement()Description copied from interface:MaybeElement
If the class is bound to an element, return true.Note that when this is true, the class is bound to both an element and a type.
- Specified by:
isElement
in interfaceMaybeElement<T,
C>
-
isAbstract
public boolean isAbstract()Description copied from interface:ClassInfo
If this class is abstract and thus shall never be directly instanciated.- Specified by:
isAbstract
in interfaceClassInfo<T,
C>
-
isOrdered
public boolean isOrdered()Description copied from interface:ClassInfo
Returns true if the properties of this class is ordered in XML. False if it't not.In RELAX NG context, ordered properties mean
<group>
and unordered properties mean<interleave>
. -
isFinal
public final boolean isFinal()Description copied from interface:ClassInfo
If this class is marked as final and no further extension/restriction is allowed. -
hasSubClasses
public final boolean hasSubClasses()Description copied from interface:ClassInfo
True if there's a known sub-type of this class inTypeInfoSet
.- Specified by:
hasSubClasses
in interfaceClassInfo<T,
C>
-
hasAttributeWildcard
public final boolean hasAttributeWildcard()Description copied from interface:ClassInfo
Returns true if this bean class has an attribute wildcard.This is true if the class declares an attribute wildcard, or it is inherited from its super classes.
- Specified by:
hasAttributeWildcard
in interfaceClassInfo<T,
C> - See Also:
-
inheritsAttributeWildcard
public final boolean inheritsAttributeWildcard()Description copied from interface:ClassInfo
Returns true iff this class inherits a wildcard attribute from its ancestor classes.- Specified by:
inheritsAttributeWildcard
in interfaceClassInfo<T,
C>
-
declaresAttributeWildcard
public final boolean declaresAttributeWildcard()Description copied from interface:ClassInfo
Returns true iff this class declares a wildcard attribute.- Specified by:
declaresAttributeWildcard
in interfaceClassInfo<T,
C>
-
getElementName
Description copied from interface:MaybeElement
Gets the element name of the class, if the class is bound to an element.- Specified by:
getElementName
in interfaceElement<T,
C> - Specified by:
getElementName
in interfaceMaybeElement<T,
C> - Returns:
- non-null iff
MaybeElement.isElement()
.
-
getTypeName
Description copied from interface:NonElement
Gets the primary XML type ANYTYPE_NAME of the class.A Java type can be mapped to multiple XML types, but one of them is considered "primary" and used when we generate a schema.
- Specified by:
getTypeName
in interfaceNonElement<T,
C> - Returns:
- null if the object doesn't have an explicit type ANYTYPE_NAME (AKA anonymous.)
-
isSimpleType
public final boolean isSimpleType()Description copied from interface:NonElement
Returns true if thisNonElement
maps to text in XML, without any attribute nor child elements.- Specified by:
isSimpleType
in interfaceNonElement<T,
C>
-
getLocation
Description copied from interface:Locatable
Gets the location object that this object points to. This operation could be inefficient and costly.- Specified by:
getLocation
in interfaceLocatable
-
getFactoryMethod
-
toString
-
getUpstream
Description copied from interface:Locatable
Gets the upstreamLocation
information.- Specified by:
getUpstream
in interfaceLocatable
- Returns:
- can be null.
-
reader
-
parseElementName
Parses anXmlRootElement
annotation on a class and determine the element name.- Returns:
- null if none was found.
-
parseTypeName
-
parseTypeName
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.
-
ClassInfoImpl
.