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

public Class RuntimeModelBuilder

extends ModelBuilder<Type, Class<T>, Field, Method>
Class Inheritance
Imports
com.sun.istack.Nullable, org.glassfish.jaxb.core.WhiteSpaceProcessor, org.glassfish.jaxb.core.v2.model.core.ArrayInfo, .ClassInfo, .ElementInfo, .EnumLeafInfo, .RegistryInfo, .TypeInfoSet, .ID, org.glassfish.jaxb.runtime.api.AccessorException, org.glassfish.jaxb.core.v2.model.annotation.Locatable, org.glassfish.jaxb.runtime.v2.model.annotation.RuntimeAnnotationReader, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimeNonElement, .RuntimeNonElementRef, .RuntimePropertyInfo, .RuntimeTypeInfoSet, org.glassfish.jaxb.core.v2.runtime.IllegalAnnotationException, org.glassfish.jaxb.runtime.v2.runtime.*, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.UnmarshallingContext, jakarta.activation.MimeType, org.xml.sax.SAXException, javax.xml.XMLConstants, javax.xml.namespace.QName, java.lang.reflect.Field, .Method, .Type, java.util.Map

ModelBuilder that works at the run-time by using the java.lang.reflect package.

This extends ModelBuilder by providing more functionalities such as accessing the fields and classes.

Author
Kohsuke Kawaguchi ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
RuntimeModelBuilder.IDTransducerImpl<ValueT>

Transducer implementation for ID. This transducer wraps another Transducer and adds handling for ID.

Field Summary

Modifier and TypeField and Description
public final JAXBContextImpl
context

The JAXBContextImpl for which the model is built.

Inherited from org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder:
defaultNsUrihasSwaRefnavreaderregistriestypeInfoSet

Constructor Summary

AccessConstructor and Description
public
RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map<Class<T>, Class<T>> subclassReplacements, String defaultNamespaceRemap)

Method Summary

Modifier and TypeMethod and Description
public ArrayInfo<Type, Class<T>>
protected ClassInfo<Type, Class<T>>
public ElementInfo<Type, Class<T>>
protected EnumLeafInfo<Type, Class<T>>
public static <V> Transducer<V>
createTransducer(RuntimeNonElementRef ref)

Creates a Transducer given a reference.

protected TypeInfoSet<Type, Class<T>, Field, Method>
private static QName
public RuntimeNonElement
getClassInfo(Class<T> clazz, Locatable upstream)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getClassInfo.

Builds a JAXB ClassInfo model from a given class declaration and adds that to this model owner.

public RuntimeNonElement
getClassInfo(Class<T> clazz, boolean searchForSuperClass, Locatable upstream)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getClassInfo.

For limited cases where the caller needs to search for a super class.

Inherited from org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder:
addRegistrygetNavigatorgetReadergetRegistrygetTypeInfogetTypeInfoisReplacedreportErrorsetErrorHandler

Field Detail

contextback to summary
public final JAXBContextImpl context

The JAXBContextImpl for which the model is built. Null when created for reflection.

Annotations
@Nullable

Constructor Detail

RuntimeModelBuilderback to summary
public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map<Class<T>, Class<T>> subclassReplacements, String defaultNamespaceRemap)

Method Detail

createArrayInfoback to summary
public ArrayInfo<Type, Class<T>> createArrayInfo(Locatable upstream, Type arrayType)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.createArrayInfo.

Annotations
@Override
createClassInfoback to summary
protected ClassInfo<Type, Class<T>> createClassInfo(Class<T> clazz, Locatable upstream)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.createClassInfo.

Annotations
@Override
createElementInfoback to summary
public ElementInfo<Type, Class<T>> createElementInfo(RegistryInfo<Type, Class<T>> registryInfo, Method method) throws IllegalAnnotationException

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.createElementInfo.

Annotations
@Override
createEnumLeafInfoback to summary
protected EnumLeafInfo<Type, Class<T>> createEnumLeafInfo(Class<T> clazz, Locatable upstream)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.createEnumLeafInfo.

Annotations
@Override
createTransducerback to summary
public static <V> Transducer<V> createTransducer(RuntimeNonElementRef ref)

Creates a Transducer given a reference. Used to implement RuntimeNonElementRef#getTransducer(). Shouldn't be called from anywhere else.

Todo

this is not the proper place for this class to be in.

Annotations
@SuppressWarnings:unchecked
createTypeInfoSetback to summary
protected TypeInfoSet<Type, Class<T>, Field, Method> createTypeInfoSet()

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.createTypeInfoSet.

Annotations
@Override
createXSSimpleTypeback to summary
private static QName createXSSimpleType()
getClassInfoback to summary
public RuntimeNonElement getClassInfo(Class<T> clazz, Locatable upstream)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getClassInfo.

Doc from org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getClassInfo.

Builds a JAXB ClassInfo model from a given class declaration and adds that to this model owner.

Return type is either ClassInfo or LeafInfo (for types like String or Enum-derived ones)

Annotations
@Override
getClassInfoback to summary
public RuntimeNonElement getClassInfo(Class<T> clazz, boolean searchForSuperClass, Locatable upstream)

Overrides org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getClassInfo.

Doc from org.glassfish.jaxb.runtime.v2.model.impl.ModelBuilder.getClassInfo.

For limited cases where the caller needs to search for a super class. This is necessary because we don't want subclassReplacements to kick in for the super class search, which will cause infinite recursion.

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

private final Class RuntimeModelBuilder.IDTransducerImpl<ValueT>

extends FilterTransducer<ValueT>
Class Inheritance

Transducer implementation for ID. This transducer wraps another Transducer and adds handling for ID.

Field Summary

Inherited from org.glassfish.jaxb.runtime.v2.runtime.FilterTransducer:
core

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ValueT
parse(CharSequence lexical)

Overrides org.glassfish.jaxb.runtime.v2.runtime.FilterTransducer.parse.

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

Converts the lexical representation to a value object.

Inherited from org.glassfish.jaxb.runtime.v2.runtime.FilterTransducer:
declareNamespacegetTypeNameprintuseNamespacewriteLeafElementwriteText

Constructor Detail

IDTransducerImplback to summary
public IDTransducerImpl(Transducer<ValueT> core)

Method Detail

parseback to summary
public ValueT parse(CharSequence lexical) throws AccessorException, SAXException

Overrides org.glassfish.jaxb.runtime.v2.runtime.FilterTransducer.parse.

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.)