Use this type of MarshalRecord when the marshal target is an OutputStream and the XML should not be formatted with carriage returns or indenting. This type is only used if the encoding of the OutputStream is UTF-8
XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
OutputStreamRecord record = new OutputStreamRecord();
record.setOutputStream(myOutputStream);
xmlMarshaller.marshal(myObject, record);
If the marshal(OutputStream) and setFormattedOutput(false) method is called on XMLMarshaller and the encoding is UTF-8, then the OutputStream is automatically wrapped in an OutputStream.
XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
xmlMarshaller xmlMarshaller.setFormattedOutput(false);
xmlMarshaller.marshal(myObject, myOutputStream);
org.eclipse.persistence.oxm.XMLMarshaller
| Modifier and Type | Class and Description |
|---|---|
| protected class | OutputStreamRecord.OutputStreamRecordContentHandler
This class will typically be used in conjunction with an XMLFragmentReader. |
| Modifier and Type | Field and Description |
|---|---|
| protected static final byte[] | |
| private byte[] | |
| private static final int | |
| private int | |
| protected static final byte | |
| protected static final byte[] | |
| protected static final byte[] | |
| protected static final byte | |
| protected static final byte[] | |
| protected static final byte[] | |
| protected static final byte[] | |
| protected boolean | |
| protected boolean | |
| protected static final byte[] | |
| protected static final byte[] | |
| protected static final byte[] | |
| protected static final byte[] | |
| protected static final byte | |
| protected static final byte[] | |
| protected OutputStream | |
| protected static final byte[] | |
| protected static final byte[] | |
| protected static final byte[] | |
| protected static final byte |
| 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 | |
| public OutputStream | Returns: The marshal target.Return the OutputStream that the object will be marshalled to. |
| 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 localName)Implements abstract org. |
| 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. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public void | setOutputStream(OutputStream
The marshal target. outputStream)Set the OutputStream that the object will be marshalled to. |
| 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 | startPrefixMappings(NamespaceResolver namespaceResolver)
Overrides org. |
| public void | |
| protected void | |
| protected void |