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

pack-priv Class RuntimeClassInfoImpl

extends ClassInfoImpl<Type, Class<T>, Field, Method>
implements RuntimeClassInfo, RuntimeElement
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeElement, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeTypeInfo, org.glassfish.jaxb.core.v2.model.core.TypeInfo, org.glassfish.jaxb.core.v2.model.annotation.Locatable, org.glassfish.jaxb.core.v2.model.core.Element, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeNonElement, org.glassfish.jaxb.core.v2.model.core.NonElement, org.glassfish.jaxb.core.v2.model.core.ClassInfo, org.glassfish.jaxb.core.v2.model.core.MaybeElement
Imports
com.sun.istack.NotNull, org.glassfish.jaxb.core.annotation.XmlLocation, org.glassfish.jaxb.core.v2.model.core.AttributePropertyInfo, .ElementPropertyInfo, .MapPropertyInfo, .ReferencePropertyInfo, .ValuePropertyInfo, .PropertyKind, org.glassfish.jaxb.runtime.AccessorFactory, .AccessorFactoryImpl, .InternalAccessorFactory, .XmlAccessorFactory, org.glassfish.jaxb.runtime.api.AccessorException, org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl, .Name, .Transducer, .XMLSerializer, org.glassfish.jaxb.core.v2.ClassFactory, org.glassfish.jaxb.core.v2.model.annotation.Locatable, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo, .RuntimeElement, .RuntimePropertyInfo, .RuntimeValuePropertyInfo, org.glassfish.jaxb.core.v2.runtime.IllegalAnnotationException, .Location, org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor, .TransducedAccessor, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallingContext, jakarta.xml.bind.JAXBException, org.xml.sax.Locator, .SAXException, javax.xml.namespace.QName, javax.xml.stream.XMLStreamException, java.io.IOException, java.lang.annotation.Annotation, java.lang.reflect.*, java.util.List, .Map

Author
Kohsuke Kawaguchi ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
private static class
RuntimeClassInfoImpl.TransducerImpl<BeanT>

Transducer implementation used when this class maps to PCDATA in XML.

Field Summary

Modifier and TypeField and Description
private AccessorFactory
private Accessor<?, Map<QName, String>>
private boolean
private boolean
private Transducer<ValueT>
private Accessor<?, Locator>
xmlLocationAccessor

If this class has a property annotated with XmlLocation, this field will get the accessor for it.

Inherited from org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl:
attributeWildcardclazz

Constructor Summary

AccessConstructor and Description
public
RuntimeClassInfoImpl(RuntimeModelBuilder modelBuilder, Locatable upstream, Class<T> clazz)

Method Summary

Modifier and TypeMethod and Description
private Transducer<ValueT>
calcTransducer()

Creates a transducer if this class is bound to a text in XML.

protected void
protected AccessorFactory
public RuntimeClassInfoImpl.RuntimePropertySeed
protected AttributePropertyInfo<Type, Class<T>>
private Accessor<?, Map<QName, String>>
protected ElementPropertyInfo<Type, Class<T>>
protected RuntimeClassInfoImpl.RuntimePropertySeed
protected MapPropertyInfo<Type, Class<T>>
protected ReferencePropertyInfo<Type, Class<T>>
protected ValuePropertyInfo<Type, Class<T>>
protected XmlAccessorFactory
public <B> Accessor<B, Map<QName, String>>
public final RuntimeClassInfoImpl
public Method
public Accessor<?, Locator>
getLocatorField()

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo.getLocatorField.

If this JAXB bean has a property annotated with XmlLocation, this method returns it.

public List<? extends RuntimePropertyInfo>
public RuntimePropertyInfo
public Transducer<ValueT>
getTransducer()

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeNonElement.getTransducer.

This method doesn't take the reference properties defined on RuntimeNonElementRef into account (such as ID-ness.)

Inherited from org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl:
asElementcanBeReferencedByIDREFdeclaresAttributeWildcardgetClazzgetElementNamegetLocationgetNamegetScopegetSubstitutionHeadgetTypegetTypeNamehasAttributeWildcardhasPropertieshasSubClasseshasValuePropertyinheritsAttributeWildcardisAbstractisElementisFinalisOrderedisSimpleTypereadAnnotationtoString

Field Detail

accessorFactoryback to summary
private AccessorFactory accessorFactory
attributeWildcardAccessorback to summary
private Accessor<?, Map<QName, String>> attributeWildcardAccessor
computedTransducerback to summary
private boolean computedTransducer
supressAccessorWarningsback to summary
private boolean supressAccessorWarnings
xducerback to summary
private Transducer<ValueT> xducer
xmlLocationAccessorback to summary
private Accessor<?, Locator> xmlLocationAccessor

If this class has a property annotated with XmlLocation, this field will get the accessor for it.

Todo

support method based XmlLocation

Constructor Detail

RuntimeClassInfoImplback to summary
public RuntimeClassInfoImpl(RuntimeModelBuilder modelBuilder, Locatable upstream, Class<T> clazz)

Method Detail

calcTransducerback to summary
private Transducer<ValueT> calcTransducer()

Creates a transducer if this class is bound to a text in XML.

checkFieldXmlLocationback to summary
protected void checkFieldXmlLocation(Field f)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.checkFieldXmlLocation.

Doc from org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.checkFieldXmlLocation.

This hook is used by RuntimeClassInfoImpl to look for org.glassfish.jaxb.core.annotation.XmlLocation.

Annotations
@Override
createAccessorFactoryback to summary
protected AccessorFactory createAccessorFactory(Class<T> clazz)
createAccessorSeedback to summary
public RuntimeClassInfoImpl.RuntimePropertySeed createAccessorSeed(Method getter, Method setter)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.createAccessorSeed.

Doc from org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.createAccessorSeed.

Creates a new GetterSetterPropertySeed object.

Annotations
@Override
createAttributePropertyback to summary
protected AttributePropertyInfo<Type, Class<T>> createAttributeProperty(PropertySeed<Type, Class<T>, Field, Method> seed)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.createAttributeProperty.

Annotations
@Override
createAttributeWildcardAccessorback to summary
private Accessor<?, Map<QName, String>> createAttributeWildcardAccessor()

Creates

createElementPropertyback to summary
protected ElementPropertyInfo<Type, Class<T>> createElementProperty(PropertySeed<Type, Class<T>, Field, Method> seed)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.createElementProperty.

Annotations
@Override
createFieldSeedback to summary
protected RuntimeClassInfoImpl.RuntimePropertySeed createFieldSeed(Field field)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.createFieldSeed.

Doc from org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.createFieldSeed.

Creates a new FieldPropertySeed object.

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

Annotations
@Override
createMapPropertyback to summary
protected MapPropertyInfo<Type, Class<T>> createMapProperty(PropertySeed<Type, Class<T>, Field, Method> seed)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.createMapProperty.

Annotations
@Override
createReferencePropertyback to summary
protected ReferencePropertyInfo<Type, Class<T>> createReferenceProperty(PropertySeed<Type, Class<T>, Field, Method> seed)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.createReferenceProperty.

Annotations
@Override
createValuePropertyback to summary
protected ValuePropertyInfo<Type, Class<T>> createValueProperty(PropertySeed<Type, Class<T>, Field, Method> seed)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.createValueProperty.

Annotations
@Override
findXmlAccessorFactoryAnnotationback to summary
protected XmlAccessorFactory findXmlAccessorFactoryAnnotation(Class<T> clazz)
getAttributeWildcardback to summary
public <B> Accessor<B, Map<QName, String>> getAttributeWildcard()

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo.getAttributeWildcard.

Doc from org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo.getAttributeWildcard.

If hasAttributeWildcard() is true, returns the accessor to access the property.

Annotations
@Override
@SuppressWarnings:unchecked
getBaseClassback to summary
public final RuntimeClassInfoImpl getBaseClass()

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.getBaseClass.

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo.getBaseClass, org.glassfish.jaxb.core.v2.model.core.ClassInfo.getBaseClass.

Doc from org.glassfish.jaxb.core.v2.model.core.ClassInfo.getBaseClass.

Obtains the information about the base class.

Annotations
@Override
getFactoryMethodback to summary
public Method getFactoryMethod()

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.getFactoryMethod.

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo.getFactoryMethod.

Annotations
@Override
getLocatorFieldback to summary
public Accessor<?, Locator> getLocatorField()

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo.getLocatorField.

Doc from org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo.getLocatorField.

If this JAXB bean has a property annotated with XmlLocation, this method returns it.

Annotations
@Override
getPropertiesback to summary
public List<? extends RuntimePropertyInfo> getProperties()

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.getProperties.

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo.getProperties, org.glassfish.jaxb.core.v2.model.core.ClassInfo.getProperties.

Doc from org.glassfish.jaxb.core.v2.model.core.ClassInfo.getProperties.

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.

Annotations
@Override
@SuppressWarnings:unchecked
getPropertyback to summary
public RuntimePropertyInfo getProperty(String name)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ClassInfoImpl.getProperty.

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeClassInfo.getProperty, org.glassfish.jaxb.core.v2.model.core.ClassInfo.getProperty.

Doc from org.glassfish.jaxb.core.v2.model.core.ClassInfo.getProperty.

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;
Annotations
@Override
getTransducerback to summary
public Transducer<ValueT> getTransducer()

Implements org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeNonElement.getTransducer.

Doc from org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeNonElement.getTransducer.

This method doesn't take the reference properties defined on RuntimeNonElementRef into account (such as ID-ness.)

Annotations
@Override
org.glassfish.jaxb.runtime.v2.model.impl back to summary

pack-priv final Class RuntimeClassInfoImpl.RuntimePropertySeed

extends Object
implements PropertySeed<Type, Class<T>, Field, Method>
Class Inheritance
  • java.lang.Object
  • org.glassfish.jaxb.runtime.v2.model.impl.RuntimeClassInfoImpl.RuntimePropertySeed
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.model.impl.PropertySeed, org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource, org.glassfish.jaxb.core.v2.model.annotation.Locatable

Field Summary

Modifier and TypeField and Description
private final Accessor<BeanT, ValueT>
private final PropertySeed<Type, Class<T>, Field, Method>

Constructor Summary

AccessConstructor and Description
public
RuntimePropertySeed(PropertySeed<Type, Class<T>, Field, Method> core, Accessor<BeanT, ValueT> acc)

Method Summary

Modifier and TypeMethod and Description
public Accessor<BeanT, ValueT>
public Location
getLocation()

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

Gets the location object that this object points to.

public String
getName()

Implements org.glassfish.jaxb.runtime.v2.model.impl.PropertySeed.getName.

The name of the property is a spec defined concept --- although it doesn't do so explicitly in anywhere.

public Type
getRawType()

Implements org.glassfish.jaxb.runtime.v2.model.impl.PropertySeed.getRawType.

Gets the actual data type of the field.

public Locatable
public boolean
hasAnnotation(Class<? extends Annotation> annotationType)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.hasAnnotation.

Returns true if the property has the specified annotation.

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

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.readAnnotation.

Gets the value of the specified annotation from the given property.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accback to summary
private final Accessor<BeanT, ValueT> acc
See Also
getAccessor()
coreback to summary
private final PropertySeed<Type, Class<T>, Field, Method> core

Constructor Detail

RuntimePropertySeedback to summary
public RuntimePropertySeed(PropertySeed<Type, Class<T>, Field, Method> core, Accessor<BeanT, ValueT> acc)

Method Detail

getAccessorback to summary
public Accessor<BeanT, ValueT> getAccessor()
getLocationback to summary
public Location getLocation()

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

Doc from org.glassfish.jaxb.core.v2.model.annotation.Locatable.getLocation.

Gets the location object that this object points to. This operation could be inefficient and costly.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.glassfish.jaxb.runtime.v2.model.impl.PropertySeed.getName.

Doc from org.glassfish.jaxb.runtime.v2.model.impl.PropertySeed.getName.

The name of the property is a spec defined concept --- although it doesn't do so explicitly in anywhere.

Annotations
@Override
getRawTypeback to summary
public Type getRawType()

Implements org.glassfish.jaxb.runtime.v2.model.impl.PropertySeed.getRawType.

Doc from org.glassfish.jaxb.runtime.v2.model.impl.PropertySeed.getRawType.

Gets the actual data type of the field.

The data of the property is stored by using this type.

The difference between the RuntimePropertyInfo#getIndividualType() and this method is clear when the property is a multi-value property. The RuntimePropertyInfo#getIndividualType() method returns the type of the item, but this method returns the actual collection type.

Annotations
@Override
getUpstreamback to summary
public Locatable getUpstream()

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

Doc from org.glassfish.jaxb.core.v2.model.annotation.Locatable.getUpstream.

Gets the upstream Location information.

Annotations
@Override
hasAnnotationback to summary
public boolean hasAnnotation(Class<? extends Annotation> annotationType)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.hasAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.hasAnnotation.

Returns true if the property has the specified annotation.

Short for readAnnotation(annotationType)!=null, but this method is typically faster.

Annotations
@Override
readAnnotationback to summary
public <A extends Annotation> A readAnnotation(Class<A> annotationType)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.readAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.readAnnotation.

Gets the value of the specified annotation from the given property.

When this method is used for a property that consists of a getter and setter, it returns the annotation on either of those methods. If both methods have the same annotation, it is an error.

Annotations
@Override
org.glassfish.jaxb.runtime.v2.model.impl back to summary

private final Class RuntimeClassInfoImpl.TransducerImpl<BeanT>

extends Object
implements Transducer<BeanT>
Class Inheritance
  • java.lang.Object
  • org.glassfish.jaxb.runtime.v2.model.impl.RuntimeClassInfoImpl.TransducerImpl
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.runtime.Transducer

Transducer implementation used when this class maps to PCDATA in XML.

Todo

revisit the exception handling

Field Summary

Modifier and TypeField and Description
private final Class<BeanT>
private final TransducedAccessor<BeanT>

Constructor Summary

AccessConstructor and Description
public
TransducerImpl(Class<BeanT> ownerClass, TransducedAccessor<BeanT> xacc)

Method Summary

Modifier and TypeMethod and Description
public void
declareNamespace(BeanT bean, XMLSerializer w)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.declareNamespace.

Declares the namespace URIs used in the given value to w.

public QName
getTypeName(BeanT instance)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.getTypeName.

Transducers implicitly work against a single XML type, but sometimes (most notably XMLGregorianCalendar, an instance may choose different XML types.

public BeanT
parse(CharSequence lexical)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.parse.

Converts the lexical representation to a value object.

public CharSequence
print(BeanT o)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.print.

Converts the given value to its lexical representation.

public boolean
useNamespace()

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.useNamespace.

If true, this doesn't declare any namespace, and therefore declareNamespace(Object, XMLSerializer) is no-op.

public void
public void
writeText(XMLSerializer w, BeanT o, String fieldName)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeText.

Sends the result of the print(Object) operation to one of the XMLSerializer#text(String, String) method, but with the best representation of the value, not necessarily String.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ownerClassback to summary
private final Class<BeanT> ownerClass
xaccback to summary
private final TransducedAccessor<BeanT> xacc

Constructor Detail

TransducerImplback to summary
public TransducerImpl(Class<BeanT> ownerClass, TransducedAccessor<BeanT> xacc)

Method Detail

declareNamespaceback to summary
public void declareNamespace(BeanT bean, XMLSerializer w) throws AccessorException

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.declareNamespace.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.declareNamespace.

Declares the namespace URIs used in the given value to w.

Annotations
@Override
getTypeNameback to summary
public QName getTypeName(BeanT instance)

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.getTypeName.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.getTypeName.

Transducers implicitly work against a single XML type, but sometimes (most notably XMLGregorianCalendar, an instance may choose different XML types.

Annotations
@Override
parseback to summary
public BeanT parse(CharSequence lexical) throws AccessorException, SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.parse.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.parse.

Converts the lexical representation to a value object.

Annotations
@Override
Exceptions
AccessorException:
if the transducer is used to parse an user bean that uses XmlValue, then this exception may occur when it tries to set the leaf value to the bean.
SAXException:
if the lexical form is incorrect, the error should be reported and SAXException may thrown (or it can return null to recover.)
printback to summary
public CharSequence print(BeanT o) throws AccessorException

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.print.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.print.

Converts the given value to its lexical representation.

Annotations
@NotNull
@Override
useNamespaceback to summary
public boolean useNamespace()

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.useNamespace.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.useNamespace.

If true, this doesn't declare any namespace, and therefore declareNamespace(Object, XMLSerializer) is no-op. It also means that the parse(CharSequence) method won't use the context parameter.

Annotations
@Override
writeLeafElementback to summary
public void writeLeafElement(XMLSerializer w, Name tagName, BeanT o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeLeafElement.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeLeafElement.

Sends the result of the print(Object) operation to one of the XMLSerializer#leafElement(Name, String, String) method. but with the best representation of the value, not necessarily String.

Annotations
@Override
writeTextback to summary
public void writeText(XMLSerializer w, BeanT o, String fieldName) throws IOException, SAXException, XMLStreamException, AccessorException

Implements org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeText.

Doc from org.glassfish.jaxb.runtime.v2.runtime.Transducer.writeText.

Sends the result of the print(Object) operation to one of the XMLSerializer#text(String, String) method, but with the best representation of the value, not necessarily String.

Annotations
@Override