|
BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.beanio.internal.parser.ParsingContext
org.beanio.internal.parser.MarshallingContext
org.beanio.internal.parser.format.xml.XmlMarshallingContext
public class XmlMarshallingContext
A MarshallingContext for XML records.
| Field Summary | |
|---|---|
protected Document |
document
|
protected Node |
parent
|
| Fields inherited from class org.beanio.internal.parser.ParsingContext |
|---|
MARSHALLING, UNMARSHALLING |
| Constructor Summary | |
|---|---|
XmlMarshallingContext(int groupDepth)
Constructs a new XmlMarshallingContext. |
|
| Method Summary | |
|---|---|
void |
clear()
Clear is invoked after each record 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. |
| Methods inherited from class org.beanio.internal.parser.MarshallingContext |
|---|
getBean, getComponentName, getMode, getRecordWriter, setBean, setComponentName, setRecordWriter, toArray, toList |
| Methods inherited from class org.beanio.internal.parser.ParsingContext |
|---|
createHeap, getAdjustedFieldPosition, getLocal, getRelativeFieldIndex, isRepeating, popIteration, pushIteration, setLocal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Document document
protected Node parent
| Constructor Detail |
|---|
public XmlMarshallingContext(int groupDepth)
groupDepth - the maximum depth of a group in the parser tree| Method Detail |
|---|
public void clear()
MarshallingContext
clear in class MarshallingContextpublic Object getRecordObject()
MarshallingContextRecordWriter when
MarshallingContext.writeRecord() is called.
getRecordObject in class MarshallingContext
public 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 convert
Document result, or null if not supportedpublic void setStreaming(boolean streaming)
streaming - true if marshalling a stream, false if marshalling single documentspublic boolean isStreaming()
|
BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||