public class ModelBuilder<T,C,F,M> extends Object implements ModelBuilderI<T,C,F,M>
TypeInfoSet
(a set of JAXB properties)
by using ElementInfoImpl
and ClassInfoImpl
.
from annotated Java classes.
This class uses Navigator
and AnnotationReader
to
work with arbitrary annotation source and arbitrary Java model.
For this purpose this class is parameterized.
Modifier and Type | Field and Description |
---|---|
String |
defaultNsUri
JAXB doesn't want to use namespaces unless we are told to, but WS-I BP
conformace requires JAX-RPC to always use a non-empty namespace URI.
|
boolean |
hasSwaRef
Set to true if the model includes
XmlAttachmentRef . |
Navigator<T,C,F,M> |
nav |
AnnotationReader<T,C,F,M> |
reader |
Constructor and Description |
---|
ModelBuilder(AnnotationReader<T,C,F,M> reader,
Navigator<T,C,F,M> navigator,
Map<C,C> subclassReplacements,
String defaultNamespaceRemap) |
Modifier and Type | Method and Description |
---|---|
RegistryInfo<T,C> |
addRegistry(C registryClass,
Locatable upstream)
Visits a class with
XmlRegistry and records all the element mappings
in it. |
protected ArrayInfoImpl<T,C,F,M> |
createArrayInfo(Locatable upstream,
T arrayType) |
protected ClassInfoImpl<T,C,F,M> |
createClassInfo(C clazz,
Locatable upstream) |
protected com.sun.xml.bind.v2.model.impl.ElementInfoImpl<T,C,F,M> |
createElementInfo(com.sun.xml.bind.v2.model.impl.RegistryInfoImpl<T,C,F,M> registryInfo,
M m) |
protected com.sun.xml.bind.v2.model.impl.EnumLeafInfoImpl<T,C,F,M> |
createEnumLeafInfo(C clazz,
Locatable upstream) |
protected com.sun.xml.bind.v2.model.impl.TypeInfoSetImpl<T,C,F,M> |
createTypeInfoSet() |
NonElement<T,C> |
getClassInfo(C clazz,
boolean searchForSuperClass,
Locatable upstream)
For limited cases where the caller needs to search for a super class.
|
NonElement<T,C> |
getClassInfo(C clazz,
Locatable upstream)
Builds a JAXB
ClassInfo model from a given class declaration
and adds that to this model owner. |
Navigator<T,C,F,M> |
getNavigator() |
AnnotationReader<T,C,F,M> |
getReader() |
RegistryInfo<T,C> |
getRegistry(String packageName)
Gets a
RegistryInfo for the given package. |
NonElement<T,C> |
getTypeInfo(Ref<T,C> ref)
This method is used to add a root reference to a model.
|
NonElement<T,C> |
getTypeInfo(T t,
Locatable upstream)
Have the builder recognize the type (if it hasn't done so yet),
and returns a
NonElement that represents it. |
boolean |
isReplaced(C sc) |
TypeInfoSet<T,C,F,M> |
link()
Called after all the classes are added to the type set
to "link" them together.
|
void |
reportError(IllegalAnnotationException e) |
void |
setErrorHandler(ErrorHandler errorHandler)
Sets the error handler that receives errors discovered during the model building.
|
public final AnnotationReader<T,C,F,M> reader
public final String defaultNsUri
To work around this issue, we allow the use of the empty namespaces to be replaced by a particular designated namespace URI.
This field keeps the value of that replacing namespace URI. When there's no replacement, this field is set to "".
public boolean hasSwaRef
XmlAttachmentRef
. JAX-WS
needs to know this information.protected com.sun.xml.bind.v2.model.impl.TypeInfoSetImpl<T,C,F,M> createTypeInfoSet()
public NonElement<T,C> getClassInfo(C clazz, Locatable upstream)
public NonElement<T,C> getClassInfo(C clazz, boolean searchForSuperClass, Locatable upstream)
subclassReplacements
to kick in for the super class search, which will cause infinite recursion.public NonElement<T,C> getTypeInfo(T t, Locatable upstream)
NonElement
that represents it.public NonElement<T,C> getTypeInfo(Ref<T,C> ref)
protected com.sun.xml.bind.v2.model.impl.EnumLeafInfoImpl<T,C,F,M> createEnumLeafInfo(C clazz, Locatable upstream)
protected com.sun.xml.bind.v2.model.impl.ElementInfoImpl<T,C,F,M> createElementInfo(com.sun.xml.bind.v2.model.impl.RegistryInfoImpl<T,C,F,M> registryInfo, M m) throws IllegalAnnotationException
IllegalAnnotationException
public RegistryInfo<T,C> addRegistry(C registryClass, Locatable upstream)
XmlRegistry
and records all the element mappings
in it.public RegistryInfo<T,C> getRegistry(String packageName)
RegistryInfo
for the given package.public TypeInfoSet<T,C,F,M> link()
Don't expose implementation classes in the signature.
TypeInfoSet
that represents the model,
or null if there was an error.public void setErrorHandler(ErrorHandler errorHandler)
errorHandler
- can be null.public final void reportError(IllegalAnnotationException e)
public boolean isReplaced(C sc)
public Navigator<T,C,F,M> getNavigator()
getNavigator
in interface ModelBuilderI<T,C,F,M>
Copyright © 2017 JBoss by Red Hat. All rights reserved.