class JAXBRIContextWrapper extends Object implements BindingContext
CANONICALIZATION_SUPPORT, DEFAULT_NAMESPACE_REMAP, ENABLE_XOP, RETAIN_REFERENCE_TO_INFO, SUBCLASS_REPLACEMENTS, TREAT_EVERYTHING_NILLABLE, TYPE_REFERENCES, XMLACCESSORFACTORY_SUPPORT
Constructor and Description |
---|
JAXBRIContextWrapper(com.sun.xml.bind.api.JAXBRIContext cxt,
Map<TypeInfo,com.sun.xml.bind.api.TypeReference> refs) |
Modifier and Type | Method and Description |
---|---|
XMLBridge |
createBridge(TypeInfo ti)
Creates a mini-marshaller/unmarshaller that can process a
TypeInfo . |
XMLBridge |
createFragmentBridge() |
Marshaller |
createMarshaller() |
Unmarshaller |
createUnmarshaller() |
void |
generateSchema(SchemaOutputResolver outputResolver)
Generates the schema documents from the model.
|
String |
getBuildId()
Gets the build information of the JAXB runtime.
|
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.
|
<B,V> PropertyAccessor<B,V> |
getElementPropertyAccessor(Class<B> wrapperBean,
String nsUri,
String localName)
Gets a
PropertyAccessor for the specified element property of the specified wrapper bean class. |
JAXBContext |
getJAXBContext() |
List<String> |
getKnownNamespaceURIs()
Gets the namespace URIs statically known to this
JAXBContext . |
com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfoSet |
getRuntimeTypeInfoSet() |
QName |
getTypeName(TypeInfo ti)
Returns the name of the XML Type bound to the
specified Java type.
|
QName |
getTypeName(com.sun.xml.bind.api.TypeReference tr) |
int |
hashCode() |
boolean |
hasSwaRef()
Returns true if this context includes a class
that has
XmlAttachmentRef . |
Object |
newWrapperInstace(Class<?> wrapperType) |
String |
toString() |
(package private) TypeInfo |
typeInfo(com.sun.xml.bind.api.TypeReference tr) |
(package private) com.sun.xml.bind.api.TypeReference |
typeReference(TypeInfo ti) |
com.sun.xml.bind.api.TypeReference typeReference(TypeInfo ti)
TypeInfo typeInfo(com.sun.xml.bind.api.TypeReference tr)
public Marshaller createMarshaller() throws JAXBException
createMarshaller
in interface BindingContext
JAXBException
public Unmarshaller createUnmarshaller() throws JAXBException
createUnmarshaller
in interface BindingContext
JAXBException
public void generateSchema(SchemaOutputResolver outputResolver) throws IOException
BindingContext
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 interface BindingContext
outputResolver
- this object controls the output to which schemas
will be sent.IOException
- if SchemaOutputResolver
throws an IOException
.public String getBuildId()
BindingContext
getBuildId
in interface BindingContext
public QName getElementName(Class o) throws JAXBException
BindingContext
getElementName
in interface BindingContext
JAXBException
public QName getElementName(Object o) throws JAXBException
BindingContext
getElementName
in interface BindingContext
JAXBException
- if the object is not known to this context.public <B,V> PropertyAccessor<B,V> getElementPropertyAccessor(Class<B> wrapperBean, String nsUri, String localName) throws JAXBException
BindingContext
PropertyAccessor
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 PropertyAccessor
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 interface BindingContext
B
- type of the wrapper beanV
- type of the property of the beanJAXBException
- 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()
BindingContext
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.
getKnownNamespaceURIs
in interface BindingContext
public com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfoSet getRuntimeTypeInfoSet()
public QName getTypeName(com.sun.xml.bind.api.TypeReference tr)
public boolean hasSwaRef()
BindingContext
XmlAttachmentRef
.hasSwaRef
in interface BindingContext
public XMLBridge createBridge(TypeInfo ti)
BindingContext
TypeInfo
.createBridge
in interface BindingContext
BindingContext#newInstance
.public JAXBContext getJAXBContext()
getJAXBContext
in interface BindingContext
public QName getTypeName(TypeInfo ti)
BindingContext
getTypeName
in interface BindingContext
ti
- must not be null. This must be one of the TypeInfo
s specified
in the BindingContext#newInstance
method.public XMLBridge createFragmentBridge()
createFragmentBridge
in interface BindingContext
public Object newWrapperInstace(Class<?> wrapperType) throws InstantiationException, IllegalAccessException
newWrapperInstace
in interface BindingContext
InstantiationException
IllegalAccessException
Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.