|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BindingContext
JAXBContext
enhanced with JAXB RI specific functionalities.
Subject to change without notice.
Field Summary | |
---|---|
static String |
CANONICALIZATION_SUPPORT
The property that you can specify to JAXBContext.newInstance(java.lang.String)
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(java.lang.String)
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 |
RETAIN_REFERENCE_TO_INFO
Retains references to PropertyInfos. |
static String |
SUBCLASS_REPLACEMENTS
The property that you can specify to JAXBContext.newInstance(java.lang.String)
to specify specific classes that replace the reference to generic classes. |
static String |
TREAT_EVERYTHING_NILLABLE
The property that you can specify to JAXBContext.newInstance(java.lang.String)
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(java.lang.String)
to put additional JAXB type references into the JAXBContext . |
static String |
XMLACCESSORFACTORY_SUPPORT
The property that you can specify to JAXBContext.newInstance(java.lang.String)
enable support of XmlAccessorFactory annotation in the JAXBContext . |
Method Summary | ||
---|---|---|
XMLBridge |
createBridge(TypeInfo ref)
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. |
|
|
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 . |
|
QName |
getTypeName(TypeInfo tr)
Returns the name of the XML Type bound to the specified Java type. |
|
boolean |
hasSwaRef()
Returns true if this context includes a class that has XmlAttachmentRef . |
|
Object |
newWrapperInstace(Class<?> wrapperType)
|
Field Detail |
---|
static final String DEFAULT_NAMESPACE_REMAP
JAXBContext.newInstance(java.lang.String)
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.
static final String TYPE_REFERENCES
JAXBContext.newInstance(java.lang.String)
to put additional JAXB type references into the JAXBContext
.
The value of the property is Collection
<TypeInfo
>.
Those TypeInfo
s can then be used to create XMLBridge
s.
This mechanism allows additional element declarations that were not a part of
the schema into the created JAXBContext
.
static final String CANONICALIZATION_SUPPORT
JAXBContext.newInstance(java.lang.String)
and Marshaller.setProperty(String, Object)
to enable the c14n marshalling support in the JAXBContext
.
C14nSupport_ArchitectureDocument
,
Constant Field Valuesstatic final String TREAT_EVERYTHING_NILLABLE
JAXBContext.newInstance(java.lang.String)
to allow unmarshaller to honor xsi:nil anywhere, even if they are
not specifically allowed by the schema.
static final String ENABLE_XOP
static final String SUBCLASS_REPLACEMENTS
JAXBContext.newInstance(java.lang.String)
to specify specific classes that replace the reference to generic classes.
See the release notes for more details about this feature.
static final String XMLACCESSORFACTORY_SUPPORT
JAXBContext.newInstance(java.lang.String)
enable support of XmlAccessorFactory annotation in the JAXBContext
.
static final String RETAIN_REFERENCE_TO_INFO
Method Detail |
---|
Marshaller createMarshaller() throws JAXBException
JAXBException
Unmarshaller createUnmarshaller() throws JAXBException
JAXBException
JAXBContext getJAXBContext()
Object newWrapperInstace(Class<?> wrapperType) throws InstantiationException, IllegalAccessException
InstantiationException
IllegalAccessException
boolean hasSwaRef()
XmlAttachmentRef
.
@Nullable QName getElementName(@NotNull Object o) throws JAXBException
JAXBException
- if the object is not known to this context.@Nullable QName getElementName(@NotNull Class o) throws JAXBException
o
-
JAXBException
XMLBridge createBridge(@NotNull TypeInfo ref)
TypeInfo
.
BindingContext#newInstance
.XMLBridge createFragmentBridge()
<B,V> PropertyAccessor<B,V> getElementPropertyAccessor(Class<B> wrapperBean, String nsUri, String localName) throws JAXBException
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.
B
- type of the wrapper beanV
- type of the property of the bean
JAXBException
- if the specified wrapper bean is not bound by JAXB, or if it doesn't have an element property
of the given name.@NotNull List<String> getKnownNamespaceURIs()
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.
void generateSchema(@NotNull SchemaOutputResolver outputResolver) throws IOException
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.
outputResolver
- this object controls the output to which schemas
will be sent.
IOException
- if SchemaOutputResolver
throws an IOException
.QName getTypeName(@NotNull TypeInfo tr)
tr
- must not be null. This must be one of the TypeInfo
s specified
in the BindingContext#newInstance
method.
IllegalArgumentException
- if the parameter is null or not a part of the TypeInfo
s specified
in the BindingContext#newInstance
method.@NotNull String getBuildId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |