oracle.toplink.ox.record
Class WriterRecord
java.lang.Object
oracle.toplink.publicinterface.DatabaseRow
oracle.toplink.ox.record.XMLRecord
oracle.toplink.ox.record.MarshalRecord
oracle.toplink.ox.record.WriterRecord
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map, Record, java.io.Serializable
- Direct Known Subclasses:
- FormattedWriterRecord
- public class WriterRecord
- extends MarshalRecord
Use this type of MarshalRecord when the marshal target is a Writer and the
XML should be not be formatted with carriage returns and 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);
- See Also:
XMLMarshaller,
Serialized Form
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
|
Method Summary |
java.io.Writer |
getWriter()
Return the Writer that the object will be marshalled to. |
void |
setWriter(java.io.Writer writer)
Set the Writer that the object will be marshalled to. |
| Methods inherited from class oracle.toplink.publicinterface.DatabaseRow |
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 |
WriterRecord
public WriterRecord()
getWriter
public java.io.Writer getWriter()
- Return the Writer that the object will be marshalled to.
- Returns:
- The marshal target.
setWriter
public void setWriter(java.io.Writer writer)
- Set the Writer that the object will be marshalled to.
- Parameters:
writer - The marshal target.