Methods Summary |
---|
public abstract javax.xml.bind.ValidationEventHandler | getEventHandler()Return the current event handler or the default event handler if one
hasn't been set.
|
public abstract java.lang.Object | getJAXBNode(XmlNode xmlNode)Gets the JAXB object associated with the given XML element.
Once a JAXB object tree is associated with an XML fragment,
this method enables navigation between the two trees.
An association between an XML element and a JAXB object is
established by the unmarshal, marshal and update methods.
Note that this association is partial; not all XML elements
have associated JAXB objects, and not all JAXB objects have
associated XML elements.
|
public abstract java.lang.Object | getProperty(java.lang.String name)Get the particular property in the underlying implementation of
Binder. This method can only
be used to get one of
the standard JAXB defined unmarshal/marshal properties
or a provider specific property for binder, unmarshal or marshal.
Attempting to get an undefined property will result in
a PropertyException being thrown. See
Supported Unmarshal Properties
and
Supported Marshal Properties.
|
public abstract javax.xml.validation.Schema | getSchema()Gets the last {@link Schema} object (including null) set by the
{@link #setSchema(Schema)} method.
|
public abstract XmlNode | getXMLNode(java.lang.Object jaxbObject)Gets the XML element associated with the given JAXB object.
Once a JAXB object tree is associated with an XML fragment,
this method enables navigation between the two trees.
An association between an XML element and a JAXB object is
established by the bind methods and the update methods.
Note that this association is partial; not all XML elements
have associated JAXB objects, and not all JAXB objects have
associated XML elements.
|
public abstract void | marshal(java.lang.Object jaxbObject, XmlNode xmlNode)Marshal a JAXB object tree to a new XML document.
This method is similar to {@link Marshaller#marshal(Object, Node)}
with the addition of maintaining the association between JAXB objects
and the produced XML nodes,
enabling future update operations such as
{@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
When {@link #getSchema()} is non-null, the marshalled
xml content is validated during this operation.
|
public abstract void | setEventHandler(javax.xml.bind.ValidationEventHandler handler)Allow an application to register a ValidationEventHandler.
The ValidationEventHandler will be called by the JAXB Provider
if any validation errors are encountered during calls to any of the
Binder unmarshal, marshal and update methods.
Calling this method with a null parameter will cause the Binder
to revert back to the default default event handler.
|
public abstract void | setProperty(java.lang.String name, java.lang.Object value)Set the particular property in the underlying implementation of
Binder. This method can only be used to set one of
the standard JAXB defined unmarshal/marshal properties
or a provider specific property for binder, unmarshal or marshal.
Attempting to set an undefined property will result in
a PropertyException being thrown. See
Supported Unmarshal Properties
and
Supported Marshal Properties.
|
public abstract void | setSchema(javax.xml.validation.Schema schema)Specifies whether marshal, unmarshal and update methods
performs validation on their XML content.
|
public abstract java.lang.Object | unmarshal(XmlNode xmlNode)Unmarshal XML infoset view to a JAXB object tree.
This method is similar to {@link Unmarshaller#unmarshal(Node)}
with the addition of maintaining the association between XML nodes
and the produced JAXB objects, enabling future update operations,
{@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
When {@link #getSchema()} is non-null, xmlNode
and its descendants is validated during this operation.
This method throws {@link UnmarshalException} when the Binder's
{@link JAXBContext} does not have a mapping for the XML element name
or the type, specifiable via @xsi:type, of xmlNode
to a JAXB mapped class. The method {@link #unmarshal(Object, Class)}
enables an application to specify the JAXB mapped class that
the xmlNode should be mapped to.
|
public abstract javax.xml.bind.JAXBElement | unmarshal(XmlNode xmlNode, java.lang.Class declaredType)Unmarshal XML root element by provided declaredType
to a JAXB object tree.
Implements Unmarshal by Declared Type
This method is similar to {@link Unmarshaller#unmarshal(Node, Class)}
with the addition of maintaining the association between XML nodes
and the produced JAXB objects, enabling future update operations,
{@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
When {@link #getSchema()} is non-null, xmlNode
and its descendants is validated during this operation.
|
public abstract java.lang.Object | updateJAXB(XmlNode xmlNode)Takes an XML node and updates its associated JAXB object and its descendants.
This operation can be thought of as an "in-place" unmarshalling.
The difference is that instead of creating a whole new JAXB tree,
this operation updates an existing tree, reusing as much JAXB objects
as possible.
As a side-effect, this operation updates the association between
XML nodes and JAXB objects.
|
public abstract XmlNode | updateXML(java.lang.Object jaxbObject)Takes an JAXB object and updates
its associated XML node and its descendants.
This is a convenience method of:
updateXML( jaxbObject, getXMLNode(jaxbObject));
|
public abstract XmlNode | updateXML(java.lang.Object jaxbObject, XmlNode xmlNode)Changes in JAXB object tree are updated in its associated XML parse tree.
This operation can be thought of as an "in-place" marshalling.
The difference is that instead of creating a whole new XML tree,
this operation updates an existing tree while trying to preserve
the XML as much as possible.
For example, unknown elements/attributes in XML that were not bound
to JAXB will be left untouched (whereas a marshalling operation
would create a new tree that doesn't contain any of those.)
As a side-effect, this operation updates the association between
XML nodes and JAXB objects.
|