Package com.sun.xml.bind.v2.model.impl
Class RuntimeModelBuilder
- java.lang.Object
-
- com.sun.xml.bind.v2.model.impl.ModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
-
- com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder
-
- All Implemented Interfaces:
ModelBuilderI<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public class RuntimeModelBuilder extends ModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
ModelBuilder
that works at the run-time by using thejava.lang.reflect
package.This extends
ModelBuilder
by providing more functionalities such as accessing the fields and classes.- Author:
- Kohsuke Kawaguchi (kk@kohsuke.org)
-
-
Field Summary
Fields Modifier and Type Field Description JAXBContextImpl
context
TheJAXBContextImpl
for which the model is built.-
Fields inherited from class com.sun.xml.bind.v2.model.impl.ModelBuilder
defaultNsUri, hasSwaRef, nav, reader
-
-
Constructor Summary
Constructors Constructor Description RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, java.util.Map<java.lang.Class,java.lang.Class> subclassReplacements, java.lang.String defaultNamespaceRemap)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.sun.xml.bind.v2.model.impl.RuntimeArrayInfoImpl
createArrayInfo(Locatable upstream, java.lang.reflect.Type arrayType)
protected com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl
createClassInfo(java.lang.Class clazz, Locatable upstream)
com.sun.xml.bind.v2.model.impl.RuntimeElementInfoImpl
createElementInfo(com.sun.xml.bind.v2.model.impl.RegistryInfoImpl<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method> registryInfo, java.lang.reflect.Method method)
protected com.sun.xml.bind.v2.model.impl.RuntimeEnumLeafInfoImpl
createEnumLeafInfo(java.lang.Class clazz, Locatable upstream)
static Transducer
createTransducer(RuntimeNonElementRef ref)
Creates aTransducer
given a reference.protected com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl
createTypeInfoSet()
RuntimeNonElement
getClassInfo(java.lang.Class clazz, boolean searchForSuperClass, Locatable upstream)
For limited cases where the caller needs to search for a super class.RuntimeNonElement
getClassInfo(java.lang.Class clazz, Locatable upstream)
Builds a JAXBClassInfo
model from a given class declaration and adds that to this model owner.RuntimeTypeInfoSet
link()
Called after all the classes are added to the type set to "link" them together.-
Methods inherited from class com.sun.xml.bind.v2.model.impl.ModelBuilder
addRegistry, getNavigator, getReader, getRegistry, getTypeInfo, getTypeInfo, isReplaced, reportError, setErrorHandler
-
-
-
-
Field Detail
-
context
@Nullable public final JAXBContextImpl context
TheJAXBContextImpl
for which the model is built. Null when created for reflection.
-
-
Constructor Detail
-
RuntimeModelBuilder
public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, java.util.Map<java.lang.Class,java.lang.Class> subclassReplacements, java.lang.String defaultNamespaceRemap)
-
-
Method Detail
-
getClassInfo
public RuntimeNonElement getClassInfo(java.lang.Class clazz, Locatable upstream)
Description copied from class:ModelBuilder
Builds a JAXBClassInfo
model from a given class declaration and adds that to this model owner.Return type is either
ClassInfo
orLeafInfo
(for types likeString
orEnum
-derived ones)- Overrides:
getClassInfo
in classModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
-
getClassInfo
public RuntimeNonElement getClassInfo(java.lang.Class clazz, boolean searchForSuperClass, Locatable upstream)
Description copied from class:ModelBuilder
For limited cases where the caller needs to search for a super class. This is necessary because we don't wantModelBuilder.subclassReplacements
to kick in for the super class search, which will cause infinite recursion.- Overrides:
getClassInfo
in classModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
-
createEnumLeafInfo
protected com.sun.xml.bind.v2.model.impl.RuntimeEnumLeafInfoImpl createEnumLeafInfo(java.lang.Class clazz, Locatable upstream)
- Overrides:
createEnumLeafInfo
in classModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
-
createClassInfo
protected com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl createClassInfo(java.lang.Class clazz, Locatable upstream)
- Overrides:
createClassInfo
in classModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
-
createElementInfo
public com.sun.xml.bind.v2.model.impl.RuntimeElementInfoImpl createElementInfo(com.sun.xml.bind.v2.model.impl.RegistryInfoImpl<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method> registryInfo, java.lang.reflect.Method method) throws IllegalAnnotationException
- Overrides:
createElementInfo
in classModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
- Throws:
IllegalAnnotationException
-
createArrayInfo
public com.sun.xml.bind.v2.model.impl.RuntimeArrayInfoImpl createArrayInfo(Locatable upstream, java.lang.reflect.Type arrayType)
- Overrides:
createArrayInfo
in classModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
-
createTypeInfoSet
protected com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl createTypeInfoSet()
- Overrides:
createTypeInfoSet
in classModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
-
link
public RuntimeTypeInfoSet link()
Description copied from class:ModelBuilder
Called after all the classes are added to the type set to "link" them together.Don't expose implementation classes in the signature.
- Overrides:
link
in classModelBuilder<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
- Returns:
- fully built
TypeInfoSet
that represents the model, or null if there was an error.
-
createTransducer
public static Transducer createTransducer(RuntimeNonElementRef ref)
Creates aTransducer
given a reference. Used to implementRuntimeNonElementRef.getTransducer()
. Shouldn't be called from anywhere else. TODO: this is not the proper place for this class to be in.
-
-