Use this type of MarshalRecord when the marshal target is a Writer and the XML should not be formatted with carriage returns or indenting.
XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
WriterRecord writerRecord = new WriterRecord();
writerRecord.setWriter(myWriter);
xmlMarshaller.marshal(myObject, writerRecord);
If the marshal(Writer) and setFormattedOutput(false) method is called on XMLMarshaller, then the Writer is automatically wrapped in a WriterRecord.
XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
xmlMarshaller xmlMarshaller.setFormattedOutput(false);
xmlMarshaller.marshal(myObject, myWriter);
org.eclipse.persistence.oxm.XMLMarshaller
| Modifier and Type | Class and Description |
|---|---|
| protected class | WriterRecord.WriterRecordContentHandler
This class will typically be used in conjunction with an XMLFragmentReader. |
| Modifier and Type | Field and Description |
|---|---|
| protected StringBuilder | |
| pack-priv String | |
| private static final String | |
| protected CharsetEncoder | |
| protected boolean | |
| protected boolean | |
| private Writer |
| 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 Writer | |
| 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 newNamespace, String replacement root namespace for the node
namespace URI/prefix of the node newName)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. |
| public void | setMarshaller(XMLMarshaller<ABSTRACT_SESSION extends CoreAbstractSession<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, PLATFORM extends CorePlatform<CONVERSION_MANAGER extends CoreConversionManager>, PROJECT extends CoreProject<DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>, LOGIN extends CoreLogin<PLATFORM extends CorePlatform>, SESSION extends CoreSession>, SESSION_EVENT_MANAGER extends CoreSessionEventManager<SESSION_EVENT_LISTENER extends CoreSessionEventListener>>, CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler, CONTEXT extends Context<ABSTRACT_SESSION, DESCRIPTOR, ?, ?, ?, SESSION, ?>, DESCRIPTOR extends Descriptor<?, ?, ?, ?, ?, ?, ?, ?, ?, ?>, MARSHALLER_LISTENER extends Marshaller.
Overrides org. Implements org. |
| public void | |
| 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 |