| java.lang.Object javax.xml.bind.JAXBContext com.sun.xml.bind.api.JAXBRIContext
All known Subclasses: com.sun.xml.bind.v2.runtime.JAXBContextImpl,
JAXBRIContext | abstract public class JAXBRIContext extends JAXBContext (Code) | | JAXBContext enhanced with JAXB RI specific functionalities.
Subject to change without notice.
since: 2.0 EA1 author: Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) |
Method Summary | |
abstract public Bridge | createBridge(TypeReference ref) Creates a mini-marshaller/unmarshaller that can process a
TypeReference . | abstract public BridgeContext | createBridgeContext() Creates a new
BridgeContext instance. | abstract public 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 public void | generateSchema(SchemaOutputResolver outputResolver) Generates the schema documents from the model. | public static Type | getBaseType(Type type, Class baseType) Gets the parameterization of the given base type. | abstract public String | getBuildId() Gets the build information of the JAXB runtime. | abstract public QName | getElementName(Object o) If the given object is bound to an element in XML by JAXB,
returns the element name. | abstract public 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.
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. | abstract public List<String> | getKnownNamespaceURIs() Gets the namespace URIs statically known to this
JAXBContext . | abstract public QName | getTypeName(TypeReference tr) Returns the name of the XML Type bound to the
specified Java type.
Parameters: tr - must not be null. | abstract public boolean | hasSwaRef() Returns true if this context includes a class
that has
XmlAttachmentRef . | public static String | mangleNameToClassName(String localName) Computes a Java class name from a local name. | public static String | mangleNameToPropertyName(String localName) Computes a Java class name from a local name. | public static String | mangleNameToVariableName(String localName) Computes a Java identifier from a local name. | public static JAXBRIContext | newInstance(Class[] classes, Collection<TypeReference> typeRefs, Map<Class, Class> subclassReplacements, String defaultNamespaceRemap, boolean c14nSupport, RuntimeAnnotationReader ar) Creates a new
JAXBRIContext .
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. | public static JAXBRIContext | newInstance(Class[] classes, Collection<TypeReference> typeRefs, String defaultNamespaceRemap, boolean c14nSupport) |
DEFAULT_NAMESPACE_REMAP | final public static String DEFAULT_NAMESPACE_REMAP(Code) | | The property that you can specify to
JAXBContext.newInstance to reassign the default namespace URI to something else at the runtime.
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 |
ENABLE_XOP | final public static String ENABLE_XOP(Code) | | Marshaller/Unmarshaller property to enable XOP processing.
since: 2.0 EA2 |
SUBCLASS_REPLACEMENTS | final public static String SUBCLASS_REPLACEMENTS(Code) | | The property that you can specify to
JAXBContext.newInstance to specify specific classes that replace the reference to generic classes.
See the release notes for more details about this feature.
since: 2.1 EA2 |
TREAT_EVERYTHING_NILLABLE | final public static String TREAT_EVERYTHING_NILLABLE(Code) | | 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.
since: 2.1.3 |
XMLACCESSORFACTORY_SUPPORT | final public static String XMLACCESSORFACTORY_SUPPORT(Code) | | The property that you can specify to
JAXBContext.newInstance enable support of XmlAccessorFactory annotation in the
JAXBContext .
since: 2.1 EA2 |
JAXBRIContext | protected JAXBRIContext()(Code) | | |
createBridgeContext | abstract public BridgeContext createBridgeContext()(Code) | | Creates a new
BridgeContext instance.
always a valid non-null instance. since: 2.0 EA1 |
generateEpisode | abstract public void generateEpisode(Result output)(Code) | | Generates the episode file that represents the binding known to this
JAXBContext ,
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.
Parameters: output - This receives the generated episode file. since: 2.1 |
generateSchema | abstract public void generateSchema(SchemaOutputResolver outputResolver) throws IOException(Code) | | Generates the schema documents from the model.
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 schemaswill be sent. throws: IOException - if SchemaOutputResolver throws an IOException. |
getBaseType | public static Type getBaseType(Type type, Class baseType)(Code) | | Gets the parameterization of the given base type.
For example, given the following
interface Foo extends List> {}
interface Bar extends Foo {}
This method works like this:
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 baseType Parameters: baseType - The class whose parameterization we are interested in.The use of baseType in type .or null if the type is not assignable to the base type. since: 2.0 FCS |
getBuildId | abstract public String getBuildId()(Code) | | Gets the build information of the JAXB runtime.
may be null, if the runtime is loaded by a class loader that doesn't supportthe access to the manifest informatino. |
getElementName | abstract public QName getElementName(Object o) throws JAXBException(Code) | | If the given object is bound to an element in XML by JAXB,
returns the element name.
nullif the object is not bound to an element. throws: JAXBException - if the object is not known to this context. since: 2.0 EA1 |
getElementPropertyAccessor | abstract public RawAccessor<B, V> getElementPropertyAccessor(Class<B> wrapperBean, String nsUri, String localName) throws JAXBException(Code) | | Gets a
RawAccessor 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.
< Parameters: B - >type of the wrapper bean< Parameters: V - >type of the property of the beanalways 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 propertyof the given name. since: 2.0 EA1 |
getKnownNamespaceURIs | abstract public List<String> getKnownNamespaceURIs()(Code) | | Gets the namespace URIs statically known to this
JAXBContext .
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.
always non-null. since: 2.0 EA2 |
hasSwaRef | abstract public boolean hasSwaRef()(Code) | | Returns true if this context includes a class
that has
XmlAttachmentRef .
since: 2.1 |
mangleNameToClassName | public static String mangleNameToClassName(String localName)(Code) | | Computes a Java class name from a local name.
This method faithfully implements the name mangling rule as specified in the JAXB spec.
Typically, this method returns "NameLikeThis". |
mangleNameToPropertyName | public static String mangleNameToPropertyName(String localName)(Code) | | Computes a Java class name from a local name.
This method faithfully implements the name mangling rule as specified in the JAXB spec.
This method works like
JAXBRIContext.mangleNameToClassName(String) except that it looks
for "getClass" and returns something else.
Typically, this method returns "NameLikeThis". |
mangleNameToVariableName | public static String mangleNameToVariableName(String localName)(Code) | | Computes a Java identifier from a local name.
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.
Typically, this method returns "nameLikeThis". |
Fields inherited from javax.xml.bind.JAXBContext | final public static String JAXB_CONTEXT_FACTORY(Code)(Java Doc)
|
|
|