public class XmlMarshallingContext extends MarshallingContext
MarshallingContext for XML records.| Modifier and Type | Field and Description |
|---|---|
protected Document |
document |
protected Node |
parent |
MARSHALLING, UNMARSHALLING| Constructor and Description |
|---|
XmlMarshallingContext(int groupDepth)
Constructs a new XmlMarshallingContext.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear is invoked after each bean object (record or group) is marshalled.
|
void |
closeGroup(XmlNode node)
Indicates a group element should be closed before marshalling the next record.
|
Document |
getDocument()
Returns the document being marshalled.
|
Node |
getParent()
Returns the parent node to append in the document being marshalled.
|
Object |
getRecordObject()
Returns the record object to pass to the
RecordWriter when
MarshallingContext.writeRecord() is called. |
boolean |
isStreaming()
Returns whether a stream is being marshalled, versus a single document.
|
void |
openGroup(XmlNode node)
Adds a group to be marshalled when the next record is written to
the output stream.
|
void |
setParent(Node parent)
Sets the parent node to append in the document being marshalled.
|
void |
setStreaming(boolean streaming)
Sets whether a stream is being marshalled, versus a single document.
|
Document |
toDocument(Object record)
Converts a record object to a
Document. |
void |
writeRecord()
Writes the current record object to the record writer.
|
getBean, getComponentName, getMode, getRecordWriter, setBean, setComponentName, setRecordWriter, toArray, toListcreateHeap, getAdjustedFieldPosition, getLocal, getRelativeFieldIndex, isRepeating, popIteration, pushIteration, setLocalpublic XmlMarshallingContext(int groupDepth)
groupDepth - the maximum depth of a group in the parser treepublic void clear()
MarshallingContextclear in class MarshallingContextpublic Object getRecordObject()
MarshallingContextRecordWriter when
MarshallingContext.writeRecord() is called.getRecordObject in class MarshallingContextpublic void writeRecord()
throws IOException
MarshallingContextMarshallingContext.getRecordObject() method.writeRecord in class MarshallingContextIOException - if an I/O error occurspublic Document getDocument()
Document being marshalledpublic void openGroup(XmlNode node)
node - the group element to addpublic void closeGroup(XmlNode node)
node - the XmlNode to closepublic Node getParent()
Nodepublic void setParent(Node parent)
parent - the parent Nodepublic Document toDocument(Object record)
MarshallingContextDocument.toDocument in class MarshallingContextrecord - the record object to convertDocument result, or null if not supportedpublic void setStreaming(boolean streaming)
streaming - true if marshalling a stream, false if marshalling single documentspublic boolean isStreaming()