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

public final Class JAXBContextImpl

extends JAXBRIContext
Class Inheritance
Imports
com.sun.istack.NotNull, .Pool, org.glassfish.jaxb.core.api.ErrorListener, org.glassfish.jaxb.runtime.api.*, org.glassfish.jaxb.core.unmarshaller.DOMScanner, org.glassfish.jaxb.core.util.Which, org.glassfish.jaxb.core.v2.WellKnownNamespace, org.glassfish.jaxb.runtime.v2.model.annotation.RuntimeAnnotationReader, .RuntimeInlineAnnotationReader, org.glassfish.jaxb.core.v2.model.core.Adapter, .NonElement, .Ref, org.glassfish.jaxb.runtime.v2.model.impl.RuntimeBuiltinLeafInfoImpl, .RuntimeModelBuilder, org.glassfish.jaxb.core.v2.model.nav.Navigator, org.glassfish.jaxb.core.v2.runtime.RuntimeUtil, org.glassfish.jaxb.runtime.v2.runtime.output.Encoded, org.glassfish.jaxb.runtime.v2.runtime.property.AttributeProperty, .Property, org.glassfish.jaxb.runtime.v2.runtime.reflect.Accessor, org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader, .TagName, .UnmarshallerImpl, .UnmarshallingContext, org.glassfish.jaxb.runtime.v2.schemagen.XmlSchemaGenerator, org.glassfish.jaxb.core.v2.util.EditDistance, .XmlFactory, org.glassfish.jaxb.runtime.v2.util.QNameMap, com.sun.xml.txw2.output.ResultFactory, jakarta.xml.bind.*, jakarta.xml.bind.annotation.XmlAttachmentRef, .XmlList, .XmlNs, .XmlSchema, jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter, org.glassfish.jaxb.runtime.v2.model.runtime.*, org.w3c.dom.Document, .Element, .Node, org.xml.sax.SAXException, .SAXParseException, javax.xml.namespace.QName, javax.xml.parsers.DocumentBuilder, .DocumentBuilderFactory, .FactoryConfigurationError, .ParserConfigurationException, .SAXParserFactory, javax.xml.transform.Result, .Transformer, .TransformerConfigurationException, javax.xml.transform.sax.SAXTransformerFactory, .TransformerHandler, java.io.IOException, java.lang.ref.WeakReference, java.lang.reflect.Field, .Method, .Type, java.util.*, .Map.Entry

This class provides the implementation of JAXBContext.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public final boolean
private RuntimeAnnotationReader
public Boolean
backupWithParentNamespace

If true, despite the specification, unmarshall child element with parent namespace, if child namespace is not specified.

private final Map<Class<T>, JaxBeanInfo<BeanT>>
beanInfoMap

Map from JAXB-bound Class to its JaxBeanInfo.

protected Map<RuntimeTypeInfo, JaxBeanInfo<BeanT>>
beanInfos

All created JaxBeanInfos.

private final Map<TypeReference, Bridge<T>>
bridges

All the bridge classes.

protected final boolean
c14nSupport

true to reorder attributes lexicographically in preparation of the c14n support.

private final Class<T>[]
private static DocumentBuilder
db

Shared instance of DocumentBuilder.

private final String
defaultNsUri

Input to the JAXBContext.newInstance, so that we can recreate RuntimeTypeInfoSet whenever we need.

public final boolean
disableSecurityProcessing

Disable security processing.

private final Map<Class<T>, Map<QName, ElementBeanInfoImpl>>
public final boolean
fastBoot

If true, we aim for faster JAXBContext instantiation performance, instead of going after efficient sustained unmarshalling/marshalling performance.

private boolean
public final boolean
improvedXsiTypeHandling

Improved xsi type handling.

public final Pool<Marshaller>
public final int
maxErrorsCount

The maximum number of errors unmarshall operation reports.

public NameBuilder
nameBuilder

Used to assign indices to known names in this grammar.

public final NameList
nameList

Keeps the list of known names.

private volatile SAXParserFactory
parserFactory

The parserFactory for this JAXBContext

private static final Comparator<QName>
public final boolean
retainPropertyInfo

Store properties, so that they can be recovered in the run (is here because of JSON encoding of Jersey).

private final QNameMap<JaxBeanInfo<BeanT>>
private final Map<Class<T>, Class<T>>
public final boolean
supressAccessorWarnings

Suppress reflection accessor warnings.

private WeakReference<RuntimeTypeInfoSet>
private final HashMap<QName, JaxBeanInfo<BeanT>>
public final Pool<Unmarshaller>
private Encoded[]
utf8nameTable

Cache of UTF-8 encoded local names to improve the performance for the marshalling.

public final boolean
xmlAccessorFactorySupport

Flag that user has provided a custom AccessorFactory for JAXB to use

private Set<XmlNs>
Inherited from org.glassfish.jaxb.runtime.api.JAXBRIContext:
ANNOTATION_READERBACKUP_WITH_PARENT_NAMESPACECANONICALIZATION_SUPPORTDEFAULT_NAMESPACE_REMAPDISABLE_XML_SECURITYENABLE_XOPIMPROVED_XSI_TYPE_HANDLINGMAX_ERRORSRETAIN_REFERENCE_TO_INFOSUBCLASS_REPLACEMENTSSUPRESS_ACCESSOR_WARNINGSTREAT_EVERYTHING_NILLABLETYPE_REFERENCESXMLACCESSORFACTORY_SUPPORT

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public JAXBContextImpl
createAugmented(Class<?> clazz)

Creates a that includes the specified additional classes.

public <T> Binder<T>
createBinder(Class<T> domType)

Overrides jakarta.xml.bind.JAXBContext.createBinder.

Creates a Binder object that can be used for associative/in-place unmarshalling/marshalling.

public Binder<Node>
createBinder()

Overrides jakarta.xml.bind.JAXBContext.createBinder.

Creates a Binder for W3C DOM.

public Bridge<T>
createBridge(TypeReference ref)

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.createBridge.

Creates a mini-marshaller/unmarshaller that can process a TypeReference.

pack-priv static Document
createDom(boolean disableSecurityProcessing)

Creates a new DOM document.

public JAXBIntrospector
createJAXBIntrospector()

Overrides jakarta.xml.bind.JAXBContext.createJAXBIntrospector.

Creates a JAXBIntrospector object that can be used to introspect Jakarta XML Binding objects.

public MarshallerImpl
createMarshaller()

Implements abstract jakarta.xml.bind.JAXBContext.createMarshaller.

Create a Marshaller object that can be used to convert a java content tree into XML data.

private XmlSchemaGenerator<Type, Class<T>, Field, Method>
pack-priv static Transformer
createTransformer(boolean disableSecureProcessing)

Creates a new identity transformer.

public static TransformerHandler
createTransformerHandler(boolean disableSecureProcessing)

Creates a new identity transformer.

public UnmarshallerImpl
createUnmarshaller()

Implements abstract jakarta.xml.bind.JAXBContext.createUnmarshaller.

Create an Unmarshaller object that can be used to convert XML data into a java content tree.

public void
generateEpisode(Result output)

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.generateEpisode.

Generates the episode file that represents the binding known to this JAXBContext, so that XJC can later do separate compilation.

public void
generateSchema(SchemaOutputResolver outputResolver)

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.generateSchema.

Generates the schema documents from the model.

public JaxBeanInfo<BeanT>

Returns:

null if c isn't a JAXB-bound class and fatal==false.
getBeanInfo
(Object o)

Gets the JaxBeanInfo object that can handle the given JAXB-bound object.

public JaxBeanInfo<BeanT>
getBeanInfo(Object o, boolean
if true, the failure to look up will throw an exception. Otherwise it will just return null.
fatal
)

Gets the JaxBeanInfo object that can handle the given JAXB-bound object.

public <T> JaxBeanInfo<T>

Returns:

null if c isn't a JAXB-bound class and fatal==false.
getBeanInfo
(Class<T> clazz)

Gets the JaxBeanInfo object that can handle the given JAXB-bound class.

public <T> JaxBeanInfo<T>
getBeanInfo(Class<T> clazz, boolean
if true, the failure to look up will throw an exception. Otherwise it will just return null.
fatal
)

Gets the JaxBeanInfo object that can handle the given JAXB-bound class.

public String
getBuildId()

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.getBuildId.

Gets the build information of the JAXB runtime.

public ElementBeanInfoImpl
getElement(Class<T> scope, QName name)

public QName
getElementName(Object o)

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.getElementName.

If the given object is bound to an element in XML by JAXB, returns the element name.

public QName
getElementName(Class<T> o)

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.getElementName.

Allows to retrieve the element name based on Class.

public RawAccessor<B, V>
getElementPropertyAccessor(Class<T> wrapperBean, String nsUri, String localName)

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.getElementPropertyAccessor.

Gets a RawAccessor for the specified element property of the specified wrapper bean class.

public JaxBeanInfo<BeanT>

Returns:

null if the type name is not recognized. For schema languages other than XML Schema, this method always returns null.
getGlobalType
(QName name)

Gets the JaxBeanInfo for the given named XML Schema type.

public List<String>
getKnownNamespaceURIs()

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.getKnownNamespaceURIs.

Gets the namespace URIs statically known to this JAXBContext.

public String
getNearestTypeName(QName name)

Finds a type name that this context recognizes which is "closest" to the given type name.

public int
public int
public int
private ElementBeanInfoImpl
protected JaxBeanInfo<BeanT>
protected ClassBeanInfoImpl<BeanT>
protected JaxBeanInfo<BeanT>
public JaxBeanInfo<BeanT>
public RuntimeTypeInfoSet
getRuntimeTypeInfoSet()

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.getRuntimeTypeInfoSet.

Allows you to access the runtime model information of the JAXB XML/Java binding.

public SAXParserFactory
public RuntimeTypeInfoSet
public QName
getTypeName(TypeReference tr)

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.getTypeName.

Returns the name of the XML Type bound to the specified Java type.

public synchronized Encoded[]
public Set<QName>
getValidRootNames()

Returns the set of valid root tag names.

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

public Set<XmlNs>

Returns:

set of all present XmlNs annotations
getXmlNsSet
()

Returns declared XmlNs annotations (from package-level annotation XmlSchema

private NonElement<Type, Class<T>>
public boolean
hasSwaRef()

Implements abstract org.glassfish.jaxb.runtime.api.JAXBRIContext.hasSwaRef.

True if this JAXBContext has XmlAttachmentRef.

public Loader

Returns:

null if the given name pair is not recognized.
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.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.glassfish.jaxb.runtime.api.JAXBRIContext:
getBaseTypemangleNameToClassNamemangleNameToPropertyNamemangleNameToVariableNamenewInstancenewInstance