Oracle Fusion Middleware Java API Reference for Oracle TopLink (Deprecated)
11g Release 1 (11.1.1)


Class FormattedWriterRecord

  extended by oracle.toplink.internal.sessions.AbstractRecord
      extended by oracle.toplink.ox.record.XMLRecord
          extended by oracle.toplink.ox.record.MarshalRecord
              extended by oracle.toplink.ox.record.WriterRecord
                  extended by oracle.toplink.ox.record.FormattedWriterRecord
All Implemented Interfaces:, java.lang.Cloneable, java.util.Map, Record

public class FormattedWriterRecord
extends WriterRecord

Use this type of MarshalRecord when the marshal target is a Writer and the XML should be formatted with carriage returns and indenting.

XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
FormattedWriterRecord formattedWriterRecord = new FormattedWriterRecord();
xmlMarshaller.marshal(myObject, formattedWriterRecord);

If the marshal(Writer) and setFormattedOutput(true) method is called on XMLMarshaller, then the Writer is automatically wrapped in a FormattedWriterRecord.

XMLContext xmlContext = new XMLContext("session-name");
XMLMarshaller xmlMarshaller = xmlContext.createMarshaller();
xmlMarshaller xmlMarshaller.setFormattedOutput(true);
xmlMarshaller.marshal(myObject, myWriter);

See Also:
XMLMarshaller, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map
Constructor Summary
Method Summary
 void node(org.w3c.dom.Node node, NamespaceResolver namespaceResolver)
          Receive notification of a node.
Methods inherited from class oracle.toplink.ox.record.WriterRecord
getWriter, setWriter
Methods inherited from class oracle.toplink.ox.record.MarshalRecord
clear, closeStartGroupingElements, endPrefixMapping, endPrefixMappings, getDocument, getDOM, getLocalName, getNamespaceURI, getPositionalNodes, startPrefixMapping, startPrefixMappings, transformToXML
Methods inherited from class oracle.toplink.ox.record.XMLRecord
contains, getDocPresPolicy, getNamespaceResolver, resolveNamespacePrefix, setDocPresPolicy, setNamespaceResolver
Methods inherited from class oracle.toplink.internal.sessions.AbstractRecord
containsKey, containsKey, containsValue, elements, entrySet, get, get, getValues, getValues, isEmpty, keys, keySet, put, put, putAll, size, values
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
equals, hashCode

Constructor Detail


public FormattedWriterRecord()
Method Detail


public void node(org.w3c.dom.Node node,
                 NamespaceResolver namespaceResolver)
Receive notification of a node.

node in class WriterRecord
node - The Node to be added to the document
namespaceResolver - The NamespaceResolver can be used to resolve the namespace URI/prefix of the node

Copyright © 1998, 2012, Oracle. All Rights Reserved.