All Implemented Interfaces:
AbstractMarshalRecord<CoreAbstractSession,CoreField,XMLMarshaller,NamespaceResolver>, MarshalRecord<CoreAbstractSession,CoreField,XMLMarshaller,NamespaceResolver>, XMLRecord<CoreAbstractSession>
Direct Known Subclasses:
FormattedWriterRecord

public class WriterRecord extends MarshalRecord<XMLMarshaller>

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);

See Also: