|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMarshallingContext
User interface for serializer to XML. This provides methods used to set up and control the marshalling process, as well as access to the marshalling object stack while marshalling.
Method Summary | |
---|---|
void |
endDocument()
End document. |
int |
getIndent()
Get current nesting indent spaces. |
IMarshaller |
getMarshaller(java.lang.String mapname)
Find the marshaller for a particular class in the current context. |
int |
getStackDepth()
Get current marshalling object stack depth. |
java.lang.Object |
getStackObject(int depth)
Get object from marshalling stack. |
java.lang.Object |
getStackTop()
Get top object on marshalling stack. |
java.lang.Object |
getUserContext()
Get the user context object. |
IXMLWriter |
getXmlWriter()
Get the writer being used for output. |
void |
marshalDocument(java.lang.Object root)
Marshal document from root object without XML declaration. |
void |
marshalDocument(java.lang.Object root,
java.lang.String enc,
java.lang.Boolean alone)
Marshal document from root object. |
void |
marshalDocument(java.lang.Object root,
java.lang.String enc,
java.lang.Boolean alone,
java.io.OutputStream outs)
Marshal document from root object to output stream with encoding. |
void |
marshalDocument(java.lang.Object root,
java.lang.String enc,
java.lang.Boolean alone,
java.io.Writer outw)
Marshal document from root object to writer. |
void |
popNamespaces()
End use of namespace indexes from a separate binding. |
void |
popObject()
Pop marshalled object from stack. |
void |
pushNamespaces(java.lang.String factname)
Use namespace indexes from a separate binding, as identified by that binding's factory class name. |
void |
pushObject(java.lang.Object obj)
Push created object to marshalling stack. |
void |
reset()
Reset to initial state for reuse. |
void |
setIndent(int count)
Set nesting indent spaces. |
void |
setIndent(int count,
java.lang.String newline,
char indent)
Set nesting indentation. |
void |
setOutput(java.io.OutputStream outs,
java.lang.String enc)
Set output stream and encoding. |
void |
setOutput(java.io.OutputStream outs,
java.lang.String enc,
ICharacterEscaper esc)
Set output stream with encoding and escaper. |
void |
setOutput(java.io.Writer outw)
Set output writer. |
void |
setOutput(java.io.Writer outw,
ICharacterEscaper esc)
Set output writer and escaper. |
void |
setUserContext(java.lang.Object obj)
Set a user context object. |
void |
setXmlWriter(IXMLWriter xwrite)
Set the writer being used for output. |
void |
startDocument(java.lang.String enc,
java.lang.Boolean alone)
Start document, writing the XML declaration. |
void |
startDocument(java.lang.String enc,
java.lang.Boolean alone,
java.io.OutputStream outs)
Start document with output stream and encoding. |
void |
startDocument(java.lang.String enc,
java.lang.Boolean alone,
java.io.Writer outw)
Start document with writer. |
Method Detail |
---|
void setOutput(java.io.OutputStream outs, java.lang.String enc, ICharacterEscaper esc) throws JiBXException
outs
- stream for document data outputenc
- document output encoding, or null
uses UTF-8
defaultesc
- escaper for writing characters to stream
JiBXException
- if error setting outputvoid setOutput(java.io.OutputStream outs, java.lang.String enc) throws JiBXException
outs
- stream for document data outputenc
- document output encoding, or null
uses UTF-8
default
JiBXException
- if error setting outputvoid setOutput(java.io.Writer outw, ICharacterEscaper esc)
outw
- writer for document data outputesc
- escaper for writing charactersvoid setOutput(java.io.Writer outw)
outw
- writer for document data outputIXMLWriter getXmlWriter()
void setXmlWriter(IXMLWriter xwrite)
xwrite
- XML writer used for outputint getIndent()
void setIndent(int count)
count
- number of spaces to indent per level, or disable
indentation if negativevoid setIndent(int count, java.lang.String newline, char indent)
count
- number of character to indent per level, or disable
indentation if negative (zero means new line only)newline
- sequence of characters used for a line ending
(null
means use the single character '\n')indent
- whitespace character used for indentationvoid reset()
void startDocument(java.lang.String enc, java.lang.Boolean alone) throws JiBXException
enc
- document encoding, null
uses UTF-8 defaultalone
- standalone document flag, null
if not
specified
JiBXException
- on any error (possibly wrapping other exception)void startDocument(java.lang.String enc, java.lang.Boolean alone, java.io.OutputStream outs) throws JiBXException
enc
- document encoding, null
uses UTF-8 defaultalone
- standalone document flag, null
if not
specifiedouts
- stream for document data output
JiBXException
- on any error (possibly wrapping other exception)void startDocument(java.lang.String enc, java.lang.Boolean alone, java.io.Writer outw) throws JiBXException
enc
- document encoding, null
uses UTF-8 defaultalone
- standalone document flag, null
if not
specifiedoutw
- writer for document data output
JiBXException
- on any error (possibly wrapping other exception)void endDocument() throws JiBXException
JiBXException
- on any error (possibly wrapping other exception)void marshalDocument(java.lang.Object root) throws JiBXException
endDocument()
.
root
- object at root of structure to be marshalled, which must have
a top-level mapping in the binding
JiBXException
- on any error (possibly wrapping other exception)void marshalDocument(java.lang.Object root, java.lang.String enc, java.lang.Boolean alone) throws JiBXException
startDocument(String, Boolean)
, a call to
marshal the root object using this context, and finally a call to
endDocument()
.
root
- object at root of structure to be marshalled, which must have
a top-level mapping in the bindingenc
- document encoding, null
uses UTF-8 defaultalone
- standalone document flag, null
if not
specified
JiBXException
- on any error (possibly wrapping other exception)void marshalDocument(java.lang.Object root, java.lang.String enc, java.lang.Boolean alone, java.io.OutputStream outs) throws JiBXException
startDocument(String, Boolean)
, a call to marshal the root object using
this context, and finally a call to endDocument()
.
root
- object at root of structure to be marshalled, which must have
a top-level mapping in the bindingenc
- document encoding, null
uses UTF-8 defaultalone
- standalone document flag, null
if not
specifiedouts
- stream for document data output
JiBXException
- on any error (possibly wrapping other exception)void marshalDocument(java.lang.Object root, java.lang.String enc, java.lang.Boolean alone, java.io.Writer outw) throws JiBXException
startDocument(String,
Boolean)
, a call to marshal the root object using this context, and
finally a call to endDocument()
.
root
- object at root of structure to be marshalled, which must have
a top-level mapping in the bindingenc
- document encoding, null
uses UTF-8 defaultalone
- standalone document flag, null
if not
specifiedoutw
- writer for document data output
JiBXException
- on any error (possibly wrapping other exception)void setUserContext(java.lang.Object obj)
reset()
method,
so to make use of this you need to first call the appropriate version of
the setOutput()
method, then this method, and finally one of
the marshalDocument
methods which uses the previously-set
output (not the ones which take a stream or writer as parameter, since
they call setOutput()
themselves).
obj
- user context object, or null
if clearing existing
context objectgetUserContext()
java.lang.Object getUserContext()
null
if no context object
setsetUserContext(Object)
void pushObject(java.lang.Object obj)
obj
- object being marshalledvoid popObject() throws JiBXException
JiBXException
- if no object on stackint getStackDepth()
java.lang.Object getStackObject(int depth)
depth
- object depth in stack to be retrieved (must be in the range
of zero to the current depth minus one).
java.lang.Object getStackTop()
null
if noneIMarshaller getMarshaller(java.lang.String mapname) throws JiBXException
mapname
- marshaller mapping name (generally the class name to be
handled, or abstract mapping type name)
JiBXException
- on any error (possibly wrapping other exception)void pushNamespaces(java.lang.String factname)
factname
- binding factory class name for binding defining
namespacesvoid popNamespaces()
pushNamespaces(String)
,
restoring whatever namespace usage was in effect prior to that call.
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |