Use this type of MarshalRecord when the marshal target is a ContentHandler.
XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
ContentHandlerRecord contentHandlerRecord = new ContentHandlerRecord();
marshalRecord.setContentHandler(myContentHandler);
xmlMarshaller.marshal(myObject, contentHandlerRecord);
If the marshal(ContentHandler) method is called on XMLMarshaller, then the ContentHanlder is automatically wrapped in a ContentHandlerRecord.
XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
xmlMarshaller.marshal(myObject, contentHandler);
org.eclipse.persistence.oxm.XMLMarshaller
| Modifier and Type | Field and Description |
|---|---|
| private AttributesImpl | |
| private ContentHandler | |
| pack-priv List | |
| protected boolean | |
| private LexicalHandler | |
| private List | |
| private XPathFragment |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | attribute(XPathFragment<XML_FIELD extends Field>
The XPathFragment contains the name and prefix
information about the XML element being ended. xPathFragment, NamespaceResolver The NamespaceResolver can be used to resolve the
namespace URI for the namespace prefix held by the XPathFragment (if
required). namespaceResolver, String This is the complete value for the attribute. value)Implements abstract org. Implements org. |
| public void | attribute(String
The namespace URI, if the attribute is not namespace
qualified the value of this parameter wil be null. namespaceURI, String The local name of the attribute. localName, String The qualified name of the attribute. qName, String This is the complete value for the attribute. value)Implements abstract org. Implements org. |
| public void | cdata(String
This is the value of the text to be wrapped value)Implements abstract org. Implements org. |
| public void | characters(String
This is the entire value of the text node. value)Implements abstract org. Implements org. |
| public void | closeStartElement()
Implements abstract org. Implements org. |
| public void | element(XPathFragment<XML_FIELD extends Field>
The XPathFragment of the element frag)Implements abstract org. |
| public void | endDocument()
Implements abstract org. |
| public void | endElement(XPathFragment<XML_FIELD extends Field>
The XPathFragment contains the name and prefix
information about the XML element being ended. xPathFragment, NamespaceResolver The NamespaceResolver can be used to resolve the
namespace URI for the namespace prefix held by the XPathFragment (if
required). namespaceResolver)Implements abstract org. Implements org. |
| public void | endPrefixMapping(String
The namespace prefix. prefix)Overrides org. Implements org. |
| public ContentHandler | Returns: The marshal target.Return the ContentHandler that the object will be marshalled to. |
| public void | namespaceDeclarations(NamespaceResolver
The NamespaceResolver contains the namespace
prefix and URI pairings that need to be declared. namespaceResolver)Overrides org. |
| public void | node(Node
The Node to be added to the document node, NamespaceResolver The NamespaceResolver can be used to resolve the
namespace URI/prefix of the node namespaceResolver, String replacement root name for the node uri, String replacement root namespace for the node
namespace URI/prefix of the node name)Implements abstract org. |
| private void | openAndCloseStartElement()
INTERNAL: Create a start element tag - this call results in a complete start element, i.e. closeStartElement() does not need to be called after a call to this method. |
| public void | openStartElement(XPathFragment<XML_FIELD extends Field>
The XPathFragment contains the name and prefix
information about the XML element being ended. xPathFragment, NamespaceResolver The NamespaceResolver can be used to resolve the
namespace URI for the namespace prefix held by the XPathFragment (if
required). namespaceResolver)Overrides org. Implements org. |
| public String | |
| public String | |
| public void | setContentHandler(ContentHandler
The marshal target. contentHandler)Set the ContentHandler that the object will be marshalled to. |
| public void | setLexicalHandler(LexicalHandler lexicalHandler)
Set the LexicalHandler to receive CDATA related events |
| public void | startDocument(String
The XML document will be encoded using this encoding. encoding, String This specifies the version of XML. version)Implements abstract org. |
| public void | startPrefixMapping(String
The namespace prefix. prefix, String The namespace URI. namespaceURI)Overrides org. Implements org. |
| public void | startPrefixMappings(NamespaceResolver namespaceResolver)
Overrides org. |
| attributes | back to summary |
|---|---|
| private AttributesImpl attributes | |
| contentHandler | back to summary |
|---|---|
| private ContentHandler contentHandler | |
| currentLevelPrefixMappings | back to summary |
|---|---|
| pack-priv List<String> currentLevelPrefixMappings | |
| isStartElementOpen | back to summary |
|---|---|
| protected boolean isStartElementOpen | |
| lexicalHandler | back to summary |
|---|---|
| private LexicalHandler lexicalHandler | |
| prefixMappings | back to summary |
|---|---|
| private List<List<String>> prefixMappings | |
| xPathFragment | back to summary |
|---|---|
| private XPathFragment<XML_FIELD extends Field> xPathFragment | |
| ContentHandlerRecord | back to summary |
|---|---|
| public ContentHandlerRecord() | |
| attribute | back to summary |
|---|---|
| public void attribute(XPathFragment<XML_FIELD extends Field> xPathFragment, NamespaceResolver namespaceResolver, String value) Implements abstract org. Implements org. INTERNAL:
| |
| attribute | back to summary |
|---|---|
| public void attribute(String namespaceURI, String localName, String qName, String value) Implements abstract org. Implements org. INTERNAL:
| |
| cdata | back to summary |
|---|---|
| public void cdata(String value) Implements abstract org. Implements org. INTERNAL:
| |
| characters | back to summary |
|---|---|
| public void characters(String value) Implements abstract org. Implements org. INTERNAL:
| |
| closeStartElement | back to summary |
|---|---|
| public void closeStartElement() Implements abstract org. Implements org. INTERNAL:
| |
| element | back to summary |
|---|---|
| public void element(XPathFragment<XML_FIELD extends Field> frag) Implements abstract org. INTERNAL:
| |
| endDocument | back to summary |
|---|---|
| public void endDocument() Implements abstract org. INTERNAL:
| |
| endElement | back to summary |
|---|---|
| public void endElement(XPathFragment<XML_FIELD extends Field> xPathFragment, NamespaceResolver namespaceResolver) Implements abstract org. Implements org. INTERNAL:
| |
| endPrefixMapping | back to summary |
|---|---|
| public void endPrefixMapping(String prefix) Overrides org. Implements org. INTERNAL:
| |
| getContentHandler | back to summary |
|---|---|
| public ContentHandler getContentHandler() Return the ContentHandler that the object will be marshalled to.
| |
| namespaceDeclarations | back to summary |
|---|---|
| public void namespaceDeclarations(NamespaceResolver namespaceResolver) Overrides org. INTERNAL: Add the namespace declarations to the XML document.
| |
| node | back to summary |
|---|---|
| public void node(Node node, NamespaceResolver namespaceResolver, String uri, String name) Implements abstract org. Receive notification of a node.
| |
| openAndCloseStartElement | back to summary |
|---|---|
| private void openAndCloseStartElement() INTERNAL: Create a start element tag - this call results in a complete start element, i.e. closeStartElement() does not need to be called after a call to this method. | |
| openStartElement | back to summary |
|---|---|
| public void openStartElement(XPathFragment<XML_FIELD extends Field> xPathFragment, NamespaceResolver namespaceResolver) Overrides org. Implements org. INTERNAL:
| |
| resolveNamespacePrefix | back to summary |
|---|---|
| public String resolveNamespacePrefix(XPathFragment<XML_FIELD extends Field> frag, NamespaceResolver resolver) | |
| resolveNamespacePrefix | back to summary |
|---|---|
| public String resolveNamespacePrefix(String s) Overrides org. Implements org.
| |
| setContentHandler | back to summary |
|---|---|
| public void setContentHandler(ContentHandler contentHandler) Set the ContentHandler that the object will be marshalled to.
| |
| setLexicalHandler | back to summary |
|---|---|
| public void setLexicalHandler(LexicalHandler lexicalHandler) Set the LexicalHandler to receive CDATA related events | |
| startDocument | back to summary |
|---|---|
| public void startDocument(String encoding, String version) Implements abstract org. INTERNAL:
| |
| startPrefixMapping | back to summary |
|---|---|
| public void startPrefixMapping(String prefix, String namespaceURI) Overrides org. Implements org. INTERNAL:
| |
| startPrefixMappings | back to summary |
|---|---|
| public void startPrefixMappings(NamespaceResolver namespaceResolver) Overrides org.
| |