Binder.
Todo
investigate how much in-place unmarshalling is implemented - some preliminary work is there. Probably buggy.
Todo
work on the marshaller side.
| Modifier and Type | Field and Description |
|---|---|
| private final AssociationMap | |
| private final JAXBContextImpl | context
The parent context object. |
| private MarshallerImpl | marshaller
Lazily create marshaller to do Java->XML binding. |
| private final InfosetScanner | |
| private UnmarshallerImpl | unmarshaller
Lazily created unmarshaller to do XML->Java binding. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private Object | |
| private DOMOutput | |
| private boolean | |
| public ValidationEventHandler | getEventHandler()
Implements abstract jakarta. Return the current event handler or the default event handler if one hasn't been set. |
| public Object | getJAXBNode(XmlNode xmlNode)
Implements abstract jakarta. Gets the Jakarta XML Binding object associated with the given XML element. |
| private MarshallerImpl | |
| public Marshaller. | |
| public Object | getProperty(String name)
Implements abstract jakarta. Get the particular property in the underlying implementation of
|
| public Schema | getSchema()
Implements abstract jakarta. Gets the last |
| private UnmarshallerImpl | |
| public Unmarshaller. | |
| public XmlNode | getXMLNode(Object jaxbObject)
Implements abstract jakarta. Gets the XML element associated with the given Jakarta XML Binding object. |
| public void | marshal(Object jaxbObject, XmlNode xmlNode)
Implements abstract jakarta. Marshal a Jakarta XML Binding object tree to a new XML document. |
| public void | setEventHandler(ValidationEventHandler handler)
Implements abstract jakarta. Allow an application to register a |
| public void | |
| public void | setProperty(String name, Object value)
Implements abstract jakarta. Set the particular property in the underlying implementation of
|
| public void | setSchema(Schema schema)
Implements abstract jakarta. Specifies whether marshal, unmarshal and update methods performs validation on their XML content. |
| public void | |
| public Object | unmarshal(XmlNode xmlNode)
Implements abstract jakarta. Unmarshal XML infoset view to a Jakarta XML Binding object tree. |
| public <T> JAXBElement | unmarshal(XmlNode xmlNode, Class<T> expectedType)
Implements abstract jakarta. Unmarshal XML root element by provided |
| public Object | updateJAXB(XmlNode xmlNode)
Implements abstract jakarta. Takes an XML node and updates its associated Jakarta XML Binding object and its descendants. |
| public XmlNode | updateXML(Object jaxbObject)
Implements abstract jakarta. Takes an Jakarta XML Binding object and updates its associated XML node and its descendants. |
| public XmlNode | updateXML(Object jaxbObject, XmlNode xmlNode)
Implements abstract jakarta. Changes in Jakarta XML Binding object tree are updated in its associated XML parse tree. |
| assoc | back to summary |
|---|---|
| private final AssociationMap<XmlNode> assoc A | |
| context | back to summary |
|---|---|
| private final JAXBContextImpl context The parent context object. | |
| marshaller | back to summary |
|---|---|
| private MarshallerImpl marshaller Lazily create marshaller to do Java->XML binding.
| |
| scanner | back to summary |
|---|---|
| private final InfosetScanner<XmlNode> scanner | |
| unmarshaller | back to summary |
|---|---|
| private UnmarshallerImpl unmarshaller Lazily created unmarshaller to do XML->Java binding.
| |
| BinderImpl | back to summary |
|---|---|
| pack-priv BinderImpl(JAXBContextImpl _context, InfosetScanner<XmlNode> scanner) | |
| associativeUnmarshal | back to summary |
|---|---|
| private Object associativeUnmarshal(XmlNode xmlNode, boolean inplace, Class<T> expectedType) throws JAXBException | |
| createOutput | back to summary |
|---|---|
| private DOMOutput createOutput(XmlNode xmlNode) | |
| excludeProperty | back to summary |
|---|---|
| private boolean excludeProperty(String name) | |
| getEventHandler | back to summary |
|---|---|
| public ValidationEventHandler getEventHandler() Implements abstract jakarta. Doc from jakarta. Return the current event handler or the default event handler if one hasn't been set.
| |
| getJAXBNode | back to summary |
|---|---|
| public Object getJAXBNode(XmlNode xmlNode) Implements abstract jakarta. Doc from jakarta. Gets the Jakarta XML Binding object associated with the given XML element. Once a Jakarta XML Binding object tree is associated with an XML fragment, this method enables navigation between the two trees. An association between an XML element and a Jakarta XML Binding object is established by the unmarshal, marshal and update methods. Note that this association is partial; not all XML elements have associated Jakarta XML Binding objects, and not all Jakarta XML Binding objects have associated XML elements.
| |
| getMarshaller | back to summary |
|---|---|
| private MarshallerImpl getMarshaller() | |
| getMarshallerListener | back to summary |
|---|---|
| public Marshaller. | |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name) throws PropertyException Implements abstract jakarta. Doc from jakarta. Get the particular property in the underlying implementation of
| |
| getSchema | back to summary |
|---|---|
| public Schema getSchema() Implements abstract jakarta. Doc from jakarta. Gets the last
| |
| getUnmarshaller | back to summary |
|---|---|
| private UnmarshallerImpl getUnmarshaller() | |
| getUnmarshallerListener | back to summary |
|---|---|
| public Unmarshaller. | |
| getXMLNode | back to summary |
|---|---|
| public XmlNode getXMLNode(Object jaxbObject) Implements abstract jakarta. Doc from jakarta. Gets the XML element associated with the given Jakarta XML Binding object. Once a Jakarta XML Binding object tree is associated with an XML fragment, this method enables navigation between the two trees. An association between an XML element and a Jakarta XML Binding object is established by the bind methods and the update methods. Note that this association is partial; not all XML elements have associated Jakarta XML Binding objects, and not all Jakarta XML Binding objects have associated XML elements.
| |
| marshal | back to summary |
|---|---|
| public void marshal(Object jaxbObject, XmlNode xmlNode) throws JAXBException Implements abstract jakarta. Doc from jakarta. Marshal a Jakarta XML Binding object tree to a new XML document.
This method is similar to
When
| |
| setEventHandler | back to summary |
|---|---|
| public void setEventHandler(ValidationEventHandler handler) throws JAXBException Implements abstract jakarta. Doc from jakarta. Allow an application to register a
The Calling this method with a null parameter will cause the Binder to revert back to the default default event handler.
| |
| setMarshallerListener | back to summary |
|---|---|
| public void setMarshallerListener(Marshaller. | |
| setProperty | back to summary |
|---|---|
| public void setProperty(String name, Object value) throws PropertyException Implements abstract jakarta. Doc from jakarta. Set the particular property in the underlying implementation of
| |
| setSchema | back to summary |
|---|---|
| public void setSchema(Schema schema) Implements abstract jakarta. Doc from jakarta. Specifies whether marshal, unmarshal and update methods performs validation on their XML content.
| |
| setUnmarshallerListener | back to summary |
|---|---|
| public void setUnmarshallerListener(Unmarshaller. | |
| unmarshal | back to summary |
|---|---|
| public Object unmarshal(XmlNode xmlNode) throws JAXBException Implements abstract jakarta. Doc from jakarta. Unmarshal XML infoset view to a Jakarta XML Binding object tree.
This method is similar to
When
This method throws
| |
| unmarshal | back to summary |
|---|---|
| public <T> JAXBElement Implements abstract jakarta. Doc from jakarta. Unmarshal XML root element by provided Implements Unmarshal by Declared Type
This method is similar to
When
| |
| updateJAXB | back to summary |
|---|---|
| public Object updateJAXB(XmlNode xmlNode) throws JAXBException Implements abstract jakarta. Doc from jakarta. Takes an XML node and updates its associated Jakarta XML Binding 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 Jakarta XML Binding tree, this operation updates an existing tree, reusing as much Jakarta XML Binding objects as possible. As a side-effect, this operation updates the association between XML nodes and Jakarta XML Binding objects.
| |
| updateXML | back to summary |
|---|---|
| public XmlNode updateXML(Object jaxbObject) throws JAXBException Implements abstract jakarta. Doc from jakarta. Takes an Jakarta XML Binding object and updates its associated XML node and its descendants. This is a convenience method of: updateXML( jaxbObject, getXMLNode(jaxbObject));
| |
| updateXML | back to summary |
|---|---|
| public XmlNode updateXML(Object jaxbObject, XmlNode xmlNode) throws JAXBException Implements abstract jakarta. Doc from jakarta. Changes in Jakarta XML Binding 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 Jakarta XML Binding 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 Jakarta XML Binding objects.
| |