|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.xml.bind.JAXBContext
com.sun.xml.bind.api.JAXBRIContext
com.sun.xml.bind.v2.runtime.JAXBContextImpl
public final class JAXBContextImpl
This class provides the implementation of JAXBContext.
| Nested Class Summary | |
|---|---|
static class |
JAXBContextImpl.JAXBContextBuilder
|
| Field Summary | |
|---|---|
boolean |
allNillable
|
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<javax.xml.bind.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<javax.xml.bind.Unmarshaller> |
unmarshallerPool
|
boolean |
xmlAccessorFactorySupport
Flag that user has provided a custom AccessorFactory for JAXB to use |
| Fields inherited from class com.sun.xml.bind.api.JAXBRIContext |
|---|
ANNOTATION_READER, 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_SUPPORT |
| Fields inherited from class javax.xml.bind.JAXBContext |
|---|
JAXB_CONTEXT_FACTORY |
| Method Summary | ||
|---|---|---|
JAXBContextImpl |
createAugmented(java.lang.Class<?> clazz)
Creates a JAXBContextImpl that includes the specified additional classes. |
|
javax.xml.bind.Binder<org.w3c.dom.Node> |
createBinder()
|
|
|
createBinder(java.lang.Class<T> domType)
|
|
Bridge |
createBridge(TypeReference ref)
Creates a mini-marshaller/unmarshaller that can process a TypeReference. |
|
BridgeContext |
createBridgeContext()
Creates a new BridgeContext instance. |
|
javax.xml.bind.JAXBIntrospector |
createJAXBIntrospector()
|
|
MarshallerImpl |
createMarshaller()
|
|
javax.xml.bind.SchemaOutputResolver |
createTestResolver()
Used for testing. |
|
static javax.xml.transform.sax.TransformerHandler |
createTransformerHandler(boolean disableSecureProcessing)
Creates a new identity transformer. |
|
UnmarshallerImpl |
createUnmarshaller()
|
|
javax.xml.bind.Validator |
createValidator()
|
|
void |
generateEpisode(javax.xml.transform.Result output)
Generates the episode file that represents the binding known to this JAXBContext,
so that XJC can later do separate compilation. |
|
void |
generateSchema(javax.xml.bind.SchemaOutputResolver outputResolver)
Generates the schema documents from the model. |
|
|
getBeanInfo(java.lang.Class<T> clazz)
Gets the JaxBeanInfo object that can handle
the given JAXB-bound class. |
|
|
getBeanInfo(java.lang.Class<T> clazz,
boolean fatal)
Gets the JaxBeanInfo object that can handle
the given JAXB-bound class. |
|
JaxBeanInfo |
getBeanInfo(java.lang.Object o)
Gets the JaxBeanInfo object that can handle
the given JAXB-bound object. |
|
JaxBeanInfo |
getBeanInfo(java.lang.Object o,
boolean fatal)
Gets the JaxBeanInfo object that can handle
the given JAXB-bound object. |
|
java.lang.String |
getBuildId()
Gets the build information of the JAXB runtime. |
|
ElementBeanInfoImpl |
getElement(java.lang.Class scope,
javax.xml.namespace.QName name)
|
|
javax.xml.namespace.QName |
getElementName(java.lang.Class o)
Allows to retrieve the element name based on Class. |
|
javax.xml.namespace.QName |
getElementName(java.lang.Object o)
If the given object is bound to an element in XML by JAXB, returns the element name. |
|
RawAccessor |
getElementPropertyAccessor(java.lang.Class wrapperBean,
java.lang.String nsUri,
java.lang.String localName)
Gets a RawAccessor for the specified element property of the specified wrapper bean class. |
|
JaxBeanInfo |
getGlobalType(javax.xml.namespace.QName name)
Gets the JaxBeanInfo for the given named XML Schema type. |
|
java.util.List<java.lang.String> |
getKnownNamespaceURIs()
Gets the namespace URIs statically known to this JAXBContext. |
|
java.lang.String |
getNearestTypeName(javax.xml.namespace.QName name)
Finds a type name that this context recognizes which is "closest" to the given type name. |
|
int |
getNumberOfAttributeNames()
|
|
int |
getNumberOfElementNames()
|
|
int |
getNumberOfLocalNames()
|
|
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. |
|
javax.xml.namespace.QName |
getTypeName(TypeReference tr)
Returns the name of the XML Type bound to the specified Java type. |
|
Encoded[] |
getUTF8NameTable()
|
|
java.util.Set<javax.xml.namespace.QName> |
getValidRootNames()
Returns the set of valid root tag names. |
|
java.lang.String |
getXMIMEContentType(java.lang.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. |
|
java.util.Set<javax.xml.bind.annotation.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. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class com.sun.xml.bind.api.JAXBRIContext |
|---|
getBaseType, mangleNameToClassName, mangleNameToPropertyName, mangleNameToVariableName, newInstance, newInstance, newInstance |
| Methods inherited from class javax.xml.bind.JAXBContext |
|---|
newInstance, newInstance, newInstance, newInstance, newInstance |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final com.sun.istack.Pool<javax.xml.bind.Marshaller> marshallerPool
Marshallers.
public final com.sun.istack.Pool<javax.xml.bind.Unmarshaller> unmarshallerPool
public NameBuilder nameBuilder
public final NameList nameList
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.
| Method Detail |
|---|
public java.util.Set<javax.xml.bind.annotation.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 JAXBRIContext
public RuntimeTypeInfoSet getTypeInfoSet()
throws IllegalAnnotationsException
RuntimeTypeInfoSet.
IllegalAnnotationsException
public ElementBeanInfoImpl getElement(java.lang.Class scope,
javax.xml.namespace.QName name)
public JaxBeanInfo getOrCreate(RuntimeTypeInfo e)
public final JaxBeanInfo getBeanInfo(java.lang.Object o)
JaxBeanInfo object that can handle
the given JAXB-bound object.
This method traverses the base classes of the given object.
public final JaxBeanInfo getBeanInfo(java.lang.Object o,
boolean fatal)
throws javax.xml.bind.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.
javax.xml.bind.JAXBExceptionpublic final <T> JaxBeanInfo<T> getBeanInfo(java.lang.Class<T> clazz)
JaxBeanInfo object that can handle
the given JAXB-bound class.
This method doesn't look for base classes.
public final <T> JaxBeanInfo<T> getBeanInfo(java.lang.Class<T> clazz,
boolean fatal)
throws javax.xml.bind.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.
javax.xml.bind.JAXBException
public final Loader selectRootLoader(UnmarshallingContext.State state,
TagName tag)
public JaxBeanInfo getGlobalType(javax.xml.namespace.QName name)
JaxBeanInfo for the given named XML Schema type.
public java.lang.String getNearestTypeName(javax.xml.namespace.QName name)
This method is used for error recovery.
public java.util.Set<javax.xml.namespace.QName> getValidRootNames()
public Encoded[] getUTF8NameTable()
public int getNumberOfLocalNames()
public int getNumberOfElementNames()
public int getNumberOfAttributeNames()
public static javax.xml.transform.sax.TransformerHandler createTransformerHandler(boolean disableSecureProcessing)
public MarshallerImpl createMarshaller()
createMarshaller in class javax.xml.bind.JAXBContextpublic UnmarshallerImpl createUnmarshaller()
createUnmarshaller in class javax.xml.bind.JAXBContextpublic javax.xml.bind.Validator createValidator()
createValidator in class javax.xml.bind.JAXBContextpublic javax.xml.bind.JAXBIntrospector createJAXBIntrospector()
createJAXBIntrospector in class javax.xml.bind.JAXBContextpublic void generateEpisode(javax.xml.transform.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(javax.xml.bind.SchemaOutputResolver outputResolver)
throws java.io.IOException
JAXBRIContextThe 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.
java.io.IOException - if SchemaOutputResolver throws an IOException.public javax.xml.namespace.QName getTypeName(TypeReference tr)
JAXBRIContext
getTypeName 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, java.util.Map, java.lang.String, boolean, com.sun.xml.bind.v2.model.annotation.RuntimeAnnotationReader) method.
public javax.xml.bind.SchemaOutputResolver createTestResolver()
public <T> javax.xml.bind.Binder<T> createBinder(java.lang.Class<T> domType)
createBinder in class javax.xml.bind.JAXBContextpublic javax.xml.bind.Binder<org.w3c.dom.Node> createBinder()
createBinder in class javax.xml.bind.JAXBContext
public javax.xml.namespace.QName getElementName(java.lang.Object o)
throws javax.xml.bind.JAXBException
JAXBRIContext
getElementName in class JAXBRIContextjavax.xml.bind.JAXBException - if the object is not known to this context.
public javax.xml.namespace.QName getElementName(java.lang.Class o)
throws javax.xml.bind.JAXBException
JAXBRIContext
getElementName in class JAXBRIContextjavax.xml.bind.JAXBExceptionpublic Bridge createBridge(TypeReference ref)
JAXBRIContextTypeReference.
createBridge in class JAXBRIContextJAXBRIContext.newInstance(java.lang.Class[], java.util.Collection, java.util.Map, java.lang.String, boolean, com.sun.xml.bind.v2.model.annotation.RuntimeAnnotationReader) .@NotNull public BridgeContext createBridgeContext()
JAXBRIContextBridgeContext instance.
createBridgeContext in class JAXBRIContext
public RawAccessor getElementPropertyAccessor(java.lang.Class wrapperBean,
java.lang.String nsUri,
java.lang.String localName)
throws javax.xml.bind.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 JAXBRIContextjavax.xml.bind.JAXBException - if the specified wrapper bean is not bound by JAXB, or if it doesn't have an element property
of the given name.public java.util.List<java.lang.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 java.lang.String getBuildId()
JAXBRIContext
getBuildId in class JAXBRIContextpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getXMIMEContentType(java.lang.Object o)
public JAXBContextImpl createAugmented(java.lang.Class<?> clazz)
throws javax.xml.bind.JAXBException
JAXBContextImpl that includes the specified additional classes.
javax.xml.bind.JAXBException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||