com.sun.xml.bind.api
public abstract class JAXBRIContext extends JAXBContext
Subject to change without notice.
Since: 2.0 EA1
Field Summary | |
---|---|
static String | ANNOTATION_READER
The property that you can specify to JAXBContext#newInstance
to use alternative RuntimeAnnotationReader implementation.
|
static String | CANONICALIZATION_SUPPORT
The property that you can specify to JAXBContext#newInstance
and Marshaller#setProperty(String, Object)
to enable the c14n marshalling support in the JAXBContext.
|
static String | DEFAULT_NAMESPACE_REMAP
The property that you can specify to JAXBContext#newInstance
to reassign the default namespace URI to something else at the runtime.
|
static String | ENABLE_XOP
Marshaller/Unmarshaller property to enable XOP processing.
|
static String | IMPROVED_XSI_TYPE_HANDLING
Improves handling of xsi:type used on leaf properties.
|
static String | RETAIN_REFERENCE_TO_INFO
Retains references to PropertyInfos.
|
static String | SUBCLASS_REPLACEMENTS
The property that you can specify to JAXBContext#newInstance
to specify specific classes that replace the reference to generic classes.
|
static String | SUPRESS_ACCESSOR_WARNINGS
Supress security warnings when trying to access fields through reflection.
|
static String | TREAT_EVERYTHING_NILLABLE
The property that you can specify to JAXBContext#newInstance
to allow unmarshaller to honor xsi:nil anywhere, even if they are
not specifically allowed by the schema.
|
static String | TYPE_REFERENCES
The property that you can specify to JAXBContext#newInstance
to put additional JAXB type references into the JAXBContext.
|
static String | XMLACCESSORFACTORY_SUPPORT
The property that you can specify to JAXBContext#newInstance
enable support of XmlAccessorFactory annotation in the JAXBContext.
|
Constructor Summary | |
---|---|
protected | JAXBRIContext() |
Method Summary | |
---|---|
abstract Bridge | createBridge(TypeReference ref)
Creates a mini-marshaller/unmarshaller that can process a TypeReference.
|
BridgeContext | createBridgeContext()
Creates a new BridgeContext instance.
|
abstract void | generateEpisode(Result output)
Generates the episode file that represents the binding known to this JAXBContext,
so that XJC can later do separate compilation.
|
abstract void | generateSchema(SchemaOutputResolver outputResolver)
Generates the schema documents from the model.
|
Type | getBaseType(Type type, Class baseType)
Gets the parameterization of the given base type.
|
String | getBuildId()
Gets the build information of the JAXB runtime.
|
QName | getElementName(Object o)
If the given object is bound to an element in XML by JAXB,
returns the element name.
|
QName | getElementName(Class o)
Allows to retrieve the element name based on Class. |
abstract <B,V> RawAccessor<B,V> | getElementPropertyAccessor(Class<B> wrapperBean, String nsUri, String localName)
Gets a RawAccessor for the specified element property of the specified wrapper bean class.
|
List<String> | getKnownNamespaceURIs()
Gets the namespace URIs statically known to this JAXBContext.
|
abstract RuntimeTypeInfoSet | getRuntimeTypeInfoSet()
Allows you to access the runtime model information of the JAXB XML/Java binding.
|
abstract QName | getTypeName(TypeReference tr)
Returns the name of the XML Type bound to the
specified Java type.
|
abstract boolean | hasSwaRef()
Returns true if this context includes a class
that has XmlAttachmentRef.
|
String | mangleNameToClassName(String localName)
Computes a Java class name from a local name.
|
String | mangleNameToPropertyName(String localName)
Computes a Java class name from a local name.
|
String | mangleNameToVariableName(String localName)
Computes a Java identifier from a local name.
|
static JAXBRIContext | newInstance(Class[] classes, Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, String defaultNamespaceRemap, boolean c14nSupport, RuntimeAnnotationReader ar)
Creates a new JAXBRIContext.
|
static JAXBRIContext | newInstance(Class[] classes, Collection<TypeReference> typeRefs, String defaultNamespaceRemap, boolean c14nSupport) |
Since: 2.1 EA2
Since: 2.0 EA2
See Also: C14nSupport_ArchitectureDocument
The value of the property is String, and it is used as the namespace URI that succeeds the default namespace URI.
Since: 2.0 EA1
Since: 2.0 EA2
Since: 2.2.3
Since: 2.1.10
See the release notes for more details about this feature.
Since: 2.1 EA2
Since: 2.1.14, 2.2.2
Since: 2.1.3
The value of the property is Collection<TypeReference>. Those TypeReferences can then be used to create Bridges.
This mechanism allows additional element declarations that were not a part of the schema into the created JAXBContext.
Since: 2.0 EA1
Since: 2.1 EA2
Returns: null if the specified reference is not given to JAXBRIContext.
Since: 2.0 EA1
Episode file is really just a JAXB customization file, except that currently we use the RI-specific SCD to refer to schema components.
Parameters: output This receives the generated episode file.
Since: 2.1
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.
Parameters: outputResolver this object controls the output to which schemas will be sent.
Throws: IOException if SchemaOutputResolver throws an IOException.
For example, given the following
This method works like this:interface Foo extends List > {} interface Bar extends Foo
{}
getBaseClass( Bar, List ) = List getBaseClass( Bar, Foo ) = Foo
getBaseClass( Foo extends Number>, Collection ) = Collection > getBaseClass( ArrayList extends BigInteger>, List ) = List extends BigInteger>
Parameters: type The type that derives from {@code baseType} baseType The class whose parameterization we are interested in.
Returns: The use of {@code baseType} in {@code type}. or null if the type is not assignable to the base type.
Since: 2.0 FCS
Returns: may be null, if the runtime is loaded by a class loader that doesn't support the access to the manifest informatino.
Returns: null if the object is not bound to an element.
Throws: JAXBException if the object is not known to this context.
Since: 2.0 EA1
Parameters: o
Returns:
Throws: javax.xml.bind.JAXBException
Since: 2.1.10
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.
Parameters:
type of the wrapper bean
Returns: always return non-null valid accessor object.
Throws: JAXBException if the specified wrapper bean is not bound by JAXB, or if it doesn't have an element property of the given name.
Since: 2.0 EA1
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.
Returns: always non-null.
Since: 2.0 EA2
This is useful for doing a deeper integration with the JAXB RI. For more information about the model, see https://jaxb2-reflection.dev.java.net/
Since: 2.1.10
Parameters: tr must not be null. This must be one of the TypeReferences specified in the JAXBRIContext method.
Returns: null if the referenced type is an anonymous and therefore doesn't have a name.
Throws: IllegalArgumentException if the parameter is null or not a part of the TypeReferences specified in the JAXBRIContext method.
Since: 2.1
This method faithfully implements the name mangling rule as specified in the JAXB spec.
Returns: Typically, this method returns "NameLikeThis".
This method faithfully implements the name mangling rule as specified in the JAXB spec. This method works like mangleNameToClassName except that it looks for "getClass" and returns something else.
Returns: Typically, this method returns "NameLikeThis".
This method faithfully implements the name mangling rule as specified in the JAXB spec.
In JAXB, a collision with a Java reserved word (such as "return") never happens. Accordingly, this method may return an identifier that collides with reserved words.
Use JJavaName.isJavaIdentifier(String) to check for such collision.
Returns: Typically, this method returns "nameLikeThis".
JAXBContext#newInstance(Class[]) JAXBContext.newInstance()
methods may
return other JAXB providers that are not compatible with the JAX-RPC RI.
This method guarantees that the JAX-WS RI will finds the JAXB RI.
Parameters: classes
Classes to be bound. See JAXBContext#newInstance(Class[])
for the meaning. typeRefs
See TYPE_REFERENCES for the meaning of this parameter.
Can be null. subclassReplacements
See SUBCLASS_REPLACEMENTS for the meaning of this parameter.
Can be null. defaultNamespaceRemap
See DEFAULT_NAMESPACE_REMAP for the meaning of this parameter.
Can be null (and should be null for ordinary use of JAXB.) c14nSupport
See CANONICALIZATION_SUPPORT for the meaning of this parameter. ar
See ANNOTATION_READER for the meaning of this parameter.
Can be null.
Since: JAXB 2.1 EA2
Deprecated: Compatibility with older versions.