Top Description Inners Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.model.impl

public Class ClassInfoImpl<T, C, F, M>

extends TypeInfoImpl<T, C, F, M>
implements ClassInfo<T, C>, Element<T, C>
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.core.v2.model.core.Element, org.glassfish.jaxb.core.v2.model.core.TypeInfo, org.glassfish.jaxb.core.v2.model.annotation.Locatable, org.glassfish.jaxb.core.v2.model.core.ClassInfo, org.glassfish.jaxb.core.v2.model.core.MaybeElement, org.glassfish.jaxb.core.v2.model.core.NonElement
Known Direct Subclasses
org.glassfish.jaxb.runtime.v2.model.impl.RuntimeClassInfoImpl
Imports
com.sun.istack.FinalArrayList, jakarta.xml.bind.annotation.XmlAccessOrder, .XmlAccessType, .XmlAccessorOrder, .XmlAccessorType, .XmlAnyAttribute, .XmlAnyElement, .XmlAttachmentRef, .XmlAttribute, .XmlElement, .XmlElementRef, .XmlElementRefs, .XmlElementWrapper, .XmlElements, .XmlID, .XmlIDREF, .XmlInlineBinaryData, .XmlList, .XmlMimeType, .XmlMixed, .XmlRootElement, .XmlSchemaType, .XmlTransient, .XmlType, .XmlValue, jakarta.xml.bind.annotation.adapters.XmlAdapter, .XmlJavaTypeAdapter, .XmlJavaTypeAdapters, org.glassfish.jaxb.core.annotation.OverrideAnnotationOf, org.glassfish.jaxb.core.v2.model.annotation.Locatable, org.glassfish.jaxb.core.v2.model.core.AttributePropertyInfo, .ClassInfo, .Element, .ElementPropertyInfo, .ID, .MapPropertyInfo, .NonElement, .PropertyInfo, .PropertyKind, .ReferencePropertyInfo, .ValuePropertyInfo, org.glassfish.jaxb.core.v2.runtime.IllegalAnnotationException, .Location, org.glassfish.jaxb.core.v2.util.EditDistance, org.glassfish.jaxb.runtime.v2.model.annotation.MethodLocatable, javax.xml.namespace.QName, java.lang.annotation.Annotation, java.lang.reflect.Method, java.util.AbstractList, .ArrayList, .Collection, .Collections, .Comparator, .HashMap, .HashSet, .LinkedHashMap, .List, .Map, .Set, .TreeSet

A part of the ClassInfo that doesn't depend on a particular reflection library.
Author
Kohsuke Kawaguchi ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static enum
ClassInfoImpl.PropertyGroup

Represents 7 groups of properties.

private class
private static enum
ClassInfoImpl.SecondaryAnnotation

Represents 6 groups of secondary annotations

Field Summary

Modifier and TypeField and Description
private static final HashMap<Class<T>, Integer>
ANNOTATION_NUMBER_MAP

All the annotations in JAXB to their internal index.

protected PropertySeed<T, C, F, M>
attributeWildcard

If this class has a declared (not inherited) attribute wildcard, keep the reference to it.

private ClassInfoImpl<T, C, F, M>
baseClass

Lazily computed.

private boolean
protected final C
private static final String[]
private final QName
private static final Annotation[]
private M
private boolean
private FinalArrayList<PropertyInfoImpl<T, C, F, M>>
properties

Lazily created.

private String[]
propOrder

The property order.

private static final ClassInfoImpl.SecondaryAnnotation[]
private final QName
Inherited from org.glassfish.jaxb.runtime.v2.model.impl.TypeInfoImpl:
builderowner

Constructor Summary

AccessConstructor and Description
pack-priv
ClassInfoImpl(ModelBuilder<T, C, F, M> builder, Locatable upstream, C clazz)

Method Summary

Modifier and TypeMethod and Description
private void
addProperty(PropertySeed<T, C, F, M> seed, Annotation[]
all annotations on this property. It's the same as seed.readAllAnnotation(), but taken as a parameter because the caller should know it already.
annotations
,
boolean dummy)

Called only from getProperties().

public Element<T, C>
public boolean
private void
protected void
private void
collectGetterSetters(C c, Map<String, M> getters, Map<String, M> setters)

protected PropertySeed<T, C, F, M>
createAccessorSeed(M getter, M setter)

Creates a new GetterSetterPropertySeed object.

protected AttributePropertyInfo<T, C>
protected ElementPropertyInfo<T, C>
protected PropertySeed<T, C, F, M>
createFieldSeed(F f)

Creates a new FieldPropertySeed object.

protected MapPropertyInfo<T, C>
createMapProperty(PropertySeed<T, C, F, M> seed)

protected ReferencePropertyInfo<T, C>
protected ValuePropertyInfo<T, C>
public final boolean
declaresAttributeWildcard()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.declaresAttributeWildcard.

Returns true iff this class declares a wildcard attribute.

private void
ensureNoAnnotation(M method)

Makes sure that the method doesn't have any annotation, if it does, report it as an error

private void
private void
findGetterSetterProperties(XmlAccessType at)

Adds properties that consists of accessors.

private XmlAccessOrder
getAccessorOrder()

Gets the accessor order for this class by consulting XmlAccessorOrder.

private XmlAccessType
getAccessType()

Computes the XmlAccessType on this class by looking at XmlAccessorType annotations.

public ClassInfoImpl<T, C, F, M>
getBaseClass()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.getBaseClass.

Obtains the information about the base class.

private <T extends Annotation> T
getClassOrPackageAnnotation(Class<T> type)

Gets an annotation that are allowed on both class and type.

public final C
getClazz()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.getClazz.

Gets the declaration this object is wrapping.

public final QName
public Method
private PropertySeed<T, C, F, M>
getInheritedAttributeWildcard()

Gets the PropertySeed object for the inherited attribute wildcard.

public Location
getLocation()

Implements org.glassfish.jaxb.core.v2.model.annotation.Locatable.getLocation.

Gets the location object that this object points to.

public final String
getName()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.getName.

Gets the fully-qualified name of the class.

public List<? extends PropertyInfo<T, C>>
getProperties()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.getProperties.

Returns all the properties newly declared in this class.

public PropertyInfo<T, C>
getProperty(String name)

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.getProperty.

Gets the property that has the specified name.

private static String

Returns:

null if the method name doesn't look like a getter.
getPropertyNameFromGetMethod
(String name)

Returns "Foo" from "getFoo" or "isFoo".

private static String

Returns:

null if the method name doesn't look like a setter.
getPropertyNameFromSetMethod
(String name)

Returns "Foo" from "setFoo".

public ClassInfoImpl<T, C, F, M>
getScope()

Implements org.glassfish.jaxb.core.v2.model.core.Element.getScope.

Deprecated you shouldn't be invoking this method on .

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

private static Annotation
public final Element<T, C>
getSubstitutionHead()

Implements org.glassfish.jaxb.core.v2.model.core.Element.getSubstitutionHead.

If this element can substitute another element, return that element.

public final T
getType()

Implements org.glassfish.jaxb.core.v2.model.core.TypeInfo.getType.

Gets the underlying Java type that object represents.

public final QName
getTypeName()

Implements org.glassfish.jaxb.core.v2.model.core.NonElement.getTypeName.

Gets the primary XML type ANYTYPE_NAME of the class.

private boolean
hasApplicableAdapter(PropertySeed<T, C, F, M> seed, T type)

public final boolean
hasAttributeWildcard()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.hasAttributeWildcard.

Returns true if this bean class has an attribute wildcard.

private boolean

Returns:

true if the factory method was found. False if not.
hasFactoryConstructor
(XmlType t)

XmlType allows specification of factoryClass and factoryMethod.

private static boolean
hasJAXBAnnotation(Annotation[] annotations)

Returns true if the array contains a JAXB annotation.

public boolean
hasProperties()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.hasProperties.

If the class has properties, return true.

public final boolean
hasSubClasses()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.hasSubClasses.

True if there's a known sub-type of this class in TypeInfoSet.

public final boolean
hasValueProperty()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.hasValueProperty.

Returns true if this class or its ancestor has XmlValue property.

public final boolean
inheritsAttributeWildcard()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.inheritsAttributeWildcard.

Returns true iff this class inherits a wildcard attribute from its ancestor classes.

public boolean
isAbstract()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.isAbstract.

If this class is abstract and thus shall never be directly instanciated.

private boolean
isApplicable(XmlJavaTypeAdapter jta, T declaredType)

private boolean
isConsideredPublic(M m)

Returns true if the method is considered 'public'.

public final boolean
isElement()

Implements org.glassfish.jaxb.core.v2.model.core.MaybeElement.isElement.

If the class is bound to an element, return true.

public final boolean
isFinal()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.isFinal.

If this class is marked as final and no further extension/restriction is allowed.

private static boolean
isJAXBAnnotation(Annotation a)

Returns true if a given annotation is a JAXB annotation.

public boolean
isOrdered()

Implements org.glassfish.jaxb.core.v2.model.core.ClassInfo.isOrdered.

Returns true if the properties of this class is ordered in XML.

public final boolean
isSimpleType()

Implements org.glassfish.jaxb.core.v2.model.core.NonElement.isSimpleType.

Returns true if this maps to text in XML, without any attribute nor child elements.

private static <T> List<T>
makeSet(T... args)

private static <T> T
pickOne(T... args)

Picks the first non-null argument, or null if all arguments are null.

public <A extends Annotation> A
private void
resurrect(Map<String, M> methods, Set<String> complete)

If the method has an explicit annotation, allow it to participate to the processing even if it lacks the setter or the getter.

private boolean
shouldRecurseSuperClass(C sc)

Checks if the properties in this given super class should be aggregated into this class.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.glassfish.jaxb.runtime.v2.model.impl.TypeInfoImpl:
getUpstreamnavparseElementNameparseTypeNameparseTypeNamereader