public final class JAXBContextImpl extends JAXBRIContext
| Modifier and Type | Class and Description |
|---|---|
static class |
JAXBContextImpl.JAXBContextBuilder |
| Modifier and Type | Field and Description |
|---|---|
boolean |
allNillable |
Boolean |
backupWithParentNamespace
If true, despite the specification, unmarshall child element with parent namespace, if child namespace is not specified.
|
protected Map<RuntimeTypeInfo,JaxBeanInfo> |
beanInfos
All created
JaxBeanInfos. |
protected boolean |
c14nSupport
true to reorder attributes lexicographically in preparation of the c14n support.
|
boolean |
disableSecurityProcessing
Disable security processing.
|
boolean |
fastBoot
If true, we aim for faster
JAXBContext instantiation performance,
instead of going after efficient sustained unmarshalling/marshalling performance. |
boolean |
improvedXsiTypeHandling
Improved xsi type handling.
|
com.sun.istack.Pool<Marshaller> |
marshallerPool
Pool of
Marshallers. |
NameBuilder |
nameBuilder
Used to assign indices to known names in this grammar.
|
NameList |
nameList
Keeps the list of known names.
|
boolean |
retainPropertyInfo
Store properties, so that they can be recovered in the run (is here because of JSON encoding of Jersey).
|
boolean |
supressAccessorWarnings
Suppress reflection accessor warnings.
|
com.sun.istack.Pool<Unmarshaller> |
unmarshallerPool |
boolean |
xmlAccessorFactorySupport
Flag that user has provided a custom AccessorFactory for JAXB to use
|
ANNOTATION_READER, BACKUP_WITH_PARENT_NAMESPACE, CANONICALIZATION_SUPPORT, DEFAULT_NAMESPACE_REMAP, DISABLE_XML_SECURITY, ENABLE_XOP, IMPROVED_XSI_TYPE_HANDLING, RETAIN_REFERENCE_TO_INFO, SUBCLASS_REPLACEMENTS, SUPRESS_ACCESSOR_WARNINGS, TREAT_EVERYTHING_NILLABLE, TYPE_REFERENCES, XMLACCESSORFACTORY_SUPPORTJAXB_CONTEXT_FACTORY| Modifier and Type | Method and Description |
|---|---|
JAXBContextImpl |
createAugmented(Class<?> clazz)
Creates a
JAXBContextImpl that includes the specified additional classes. |
Binder<Node> |
createBinder()
Creates a Binder for W3C DOM.
|
<T> Binder<T> |
createBinder(Class<T> domType)
Creates a Binder object that can be used for
associative/in-place unmarshalling/marshalling.
|
Bridge |
createBridge(TypeReference ref)
Creates a mini-marshaller/unmarshaller that can process a
TypeReference. |
BridgeContext |
createBridgeContext()
Creates a new
BridgeContext instance. |
JAXBIntrospector |
createJAXBIntrospector()
Creates a JAXBIntrospector object that can be used to
introspect JAXB objects.
|
MarshallerImpl |
createMarshaller()
Create a Marshaller object that can be used to convert a
java content tree into XML data.
|
static TransformerHandler |
createTransformerHandler(boolean disableSecureProcessing)
Creates a new identity transformer.
|
UnmarshallerImpl |
createUnmarshaller()
Create an Unmarshaller object that can be used to convert XML
data into a java content tree.
|
Validator |
createValidator()
Validator has been made optional and deprecated in JAXB 2.0. |
void |
generateEpisode(Result output)
Generates the episode file that represents the binding known to this
JAXBContext,
so that XJC can later do separate compilation. |
void |
generateSchema(SchemaOutputResolver outputResolver)
Generates the schema documents from the model.
|
<T> JaxBeanInfo<T> |
getBeanInfo(Class<T> clazz)
Gets the
JaxBeanInfo object that can handle
the given JAXB-bound class. |
<T> JaxBeanInfo<T> |
getBeanInfo(Class<T> clazz,
boolean fatal)
Gets the
JaxBeanInfo object that can handle
the given JAXB-bound class. |
JaxBeanInfo |
getBeanInfo(Object o)
Gets the
JaxBeanInfo object that can handle
the given JAXB-bound object. |
JaxBeanInfo |
getBeanInfo(Object o,
boolean fatal)
Gets the
JaxBeanInfo object that can handle
the given JAXB-bound object. |
String |
getBuildId()
Gets the build information of the JAXB runtime.
|
ElementBeanInfoImpl |
getElement(Class scope,
QName name) |
QName |
getElementName(Class o)
Allows to retrieve the element name based on Class.
|
QName |
getElementName(Object o)
If the given object is bound to an element in XML by JAXB,
returns the element name.
|
RawAccessor |
getElementPropertyAccessor(Class wrapperBean,
String nsUri,
String localName)
Gets a
RawAccessor for the specified element property of the specified wrapper bean class. |
JaxBeanInfo |
getGlobalType(QName name)
Gets the
JaxBeanInfo for the given named XML Schema type. |
List<String> |
getKnownNamespaceURIs()
Gets the namespace URIs statically known to this
JAXBContext. |
String |
getNearestTypeName(QName name)
Finds a type name that this context recognizes which is
"closest" to the given type name.
|
int |
getNumberOfAttributeNames() |
int |
getNumberOfElementNames() |
int |
getNumberOfLocalNames() |
protected JaxBeanInfo |
getOrCreate(RuntimeArrayInfo ai) |
protected ClassBeanInfoImpl |
getOrCreate(RuntimeClassInfo ci) |
protected JaxBeanInfo |
getOrCreate(RuntimeEnumLeafInfo eli) |
JaxBeanInfo |
getOrCreate(RuntimeTypeInfo e) |
RuntimeTypeInfoSet |
getRuntimeTypeInfoSet()
Allows you to access the runtime model information of the JAXB XML/Java binding.
|
RuntimeTypeInfoSet |
getTypeInfoSet()
Creates a
RuntimeTypeInfoSet. |
QName |
getTypeName(TypeReference tr)
Returns the name of the XML Type bound to the
specified Java type.
|
Encoded[] |
getUTF8NameTable() |
Set<QName> |
getValidRootNames()
Returns the set of valid root tag names.
|
String |
getXMIMEContentType(Object o)
Gets the value of the xmime:contentType attribute on the given object, or null
if for some reason it couldn't be found, including any error.
|
Set<XmlNs> |
getXmlNsSet()
Returns declared XmlNs annotations (from package-level annotation XmlSchema
|
boolean |
hasSwaRef()
True if this JAXBContext has
XmlAttachmentRef. |
Loader |
selectRootLoader(UnmarshallingContext.State state,
TagName tag)
Based on the tag name, determine what object to unmarshal,
and then set a new object and its loader to the current unmarshaller state.
|
String |
toString() |
getBaseType, mangleNameToClassName, mangleNameToPropertyName, mangleNameToVariableName, newInstance, newInstance, newInstancenewInstance, newInstance, newInstance, newInstance, newInstanceprotected Map<RuntimeTypeInfo,JaxBeanInfo> beanInfos
JaxBeanInfos.
Updated from each JaxBeanInfos constructors to avoid infinite recursion
for a cyclic reference.
This map is only used while the JAXBContextImpl is built and set to null
to avoid keeping references too long.
public final com.sun.istack.Pool<Marshaller> marshallerPool
Marshallers.public final com.sun.istack.Pool<Unmarshaller> unmarshallerPool
public NameBuilder nameBuilder
public final NameList nameList
protected final boolean c14nSupport
public final boolean xmlAccessorFactorySupport
public final boolean allNillable
JAXBRIContext.TREAT_EVERYTHING_NILLABLEpublic final boolean retainPropertyInfo
public final boolean supressAccessorWarnings
public final boolean improvedXsiTypeHandling
public final boolean disableSecurityProcessing
public final boolean fastBoot
JAXBContext instantiation performance,
instead of going after efficient sustained unmarshalling/marshalling performance.public Boolean backupWithParentNamespace
public Set<XmlNs> getXmlNsSet()
public boolean hasSwaRef()
XmlAttachmentRef.hasSwaRef in class JAXBRIContextpublic RuntimeTypeInfoSet getRuntimeTypeInfoSet()
JAXBRIContextThis is useful for doing a deeper integration with the JAXB RI. For more information about the model, see https://jaxb2-reflection.dev.java.net/
getRuntimeTypeInfoSet in class JAXBRIContextpublic RuntimeTypeInfoSet getTypeInfoSet() throws IllegalAnnotationsException
RuntimeTypeInfoSet.IllegalAnnotationsExceptionpublic ElementBeanInfoImpl getElement(Class scope, QName name)
protected JaxBeanInfo getOrCreate(RuntimeEnumLeafInfo eli)
protected ClassBeanInfoImpl getOrCreate(RuntimeClassInfo ci)
protected JaxBeanInfo getOrCreate(RuntimeArrayInfo ai)
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e)
public final JaxBeanInfo getBeanInfo(Object o)
JaxBeanInfo object that can handle
the given JAXB-bound object.
This method traverses the base classes of the given object.
c isn't a JAXB-bound class and fatal==false.public final JaxBeanInfo getBeanInfo(Object o, boolean fatal) throws JAXBException
JaxBeanInfo object that can handle
the given JAXB-bound object.fatal - if true, the failure to look up will throw an exception.
Otherwise it will just return null.JAXBExceptionpublic final <T> JaxBeanInfo<T> getBeanInfo(Class<T> clazz)
JaxBeanInfo object that can handle
the given JAXB-bound class.
This method doesn't look for base classes.
c isn't a JAXB-bound class and fatal==false.public final <T> JaxBeanInfo<T> getBeanInfo(Class<T> clazz, boolean fatal) throws JAXBException
JaxBeanInfo object that can handle
the given JAXB-bound class.fatal - if true, the failure to look up will throw an exception.
Otherwise it will just return null.JAXBExceptionpublic final Loader selectRootLoader(UnmarshallingContext.State state, TagName tag)
public JaxBeanInfo getGlobalType(QName name)
JaxBeanInfo for the given named XML Schema type.public String getNearestTypeName(QName name)
This method is used for error recovery.
public Set<QName> getValidRootNames()
public Encoded[] getUTF8NameTable()
public int getNumberOfLocalNames()
public int getNumberOfElementNames()
public int getNumberOfAttributeNames()
public static TransformerHandler createTransformerHandler(boolean disableSecureProcessing)
public MarshallerImpl createMarshaller()
JAXBContextcreateMarshaller in class JAXBContextpublic UnmarshallerImpl createUnmarshaller()
JAXBContextcreateUnmarshaller in class JAXBContextpublic Validator createValidator()
JAXBContextValidator has been made optional and deprecated in JAXB 2.0. Please
refer to the javadoc for Validator for more detail.
Create a Validator object that can be used to validate a java content tree against its source schema.
createValidator in class JAXBContextpublic JAXBIntrospector createJAXBIntrospector()
JAXBContextcreateJAXBIntrospector in class JAXBContextpublic void generateEpisode(Result output)
JAXBRIContextJAXBContext,
so that XJC can later do separate compilation.
Episode file is really just a JAXB customization file, except that currently we use the RI-specific SCD to refer to schema components.
generateEpisode in class JAXBRIContextoutput - This receives the generated episode file.public void generateSchema(SchemaOutputResolver outputResolver) throws IOException
JAXBRIContext
The caller can use the additionalElementDecls parameter to
add element declarations to the generate schema.
For example, if the JAX-RPC passes in the following entry:
{foo}bar -> DeclaredType for java.lang.String
then JAXB generates the following element declaration (in the schema
document for the namespace "foo")"
<xs:element name="bar" type="xs:string" />
This can be used for generating schema components necessary for WSDL.
generateSchema in class JAXBRIContextoutputResolver - this object controls the output to which schemas
will be sent.IOException - if SchemaOutputResolver throws an IOException.public QName getTypeName(TypeReference tr)
JAXBRIContextgetTypeName in class JAXBRIContexttr - must not be null. This must be one of the TypeReferences specified
in the JAXBRIContext.newInstance(java.lang.Class[], java.util.Collection<com.sun.xml.bind.api.TypeReference>, java.util.Map<java.lang.Class, java.lang.Class>, java.lang.String, boolean, com.sun.xml.bind.v2.model.annotation.RuntimeAnnotationReader) method.public <T> Binder<T> createBinder(Class<T> domType)
JAXBContextcreateBinder in class JAXBContextdomType - select the DOM API to use by passing in its DOM Node class.public Binder<Node> createBinder()
JAXBContextcreateBinder in class JAXBContextpublic QName getElementName(Object o) throws JAXBException
JAXBRIContextgetElementName in class JAXBRIContextJAXBException - if the object is not known to this context.public QName getElementName(Class o) throws JAXBException
JAXBRIContextgetElementName in class JAXBRIContextJAXBExceptionpublic Bridge createBridge(TypeReference ref)
JAXBRIContextTypeReference.createBridge in class JAXBRIContextJAXBRIContext.newInstance(java.lang.Class[], java.util.Collection<com.sun.xml.bind.api.TypeReference>, java.util.Map<java.lang.Class, java.lang.Class>, java.lang.String, boolean, com.sun.xml.bind.v2.model.annotation.RuntimeAnnotationReader).@NotNull public BridgeContext createBridgeContext()
JAXBRIContextBridgeContext instance.createBridgeContext in class JAXBRIContextpublic RawAccessor getElementPropertyAccessor(Class wrapperBean, String nsUri, String localName) throws JAXBException
JAXBRIContextRawAccessor for the specified element property of the specified wrapper bean class.
This method is designed to assist the JAX-RPC RI fill in a wrapper bean (in the doc/lit/wrap mode.) In the said mode, a wrapper bean is supposed to only have properties that match elements, and for each element that appear in the content model there's one property.
Therefore, this method takes a wrapper bean and a tag name that identifies a property
on the given wrapper bean, then returns a RawAccessor that allows the caller
to set/get a value from the property of the bean.
This method is not designed for a performance. The caller is expected to cache the result.
getElementPropertyAccessor in class JAXBRIContextJAXBException - if the specified wrapper bean is not bound by JAXB, or if it doesn't have an element property
of the given name.public List<String> getKnownNamespaceURIs()
JAXBRIContextJAXBContext.
When JAXB is used to marshal into sub-trees, it declares these namespace URIs at each top-level element that it marshals. To avoid repeated namespace declarations at sub-elements, the application may declare those namespaces at a higher level.
getKnownNamespaceURIs in class JAXBRIContextpublic String getBuildId()
JAXBRIContextgetBuildId in class JAXBRIContextpublic String getXMIMEContentType(Object o)
public JAXBContextImpl createAugmented(Class<?> clazz) throws JAXBException
JAXBContextImpl that includes the specified additional classes.JAXBExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.