| com.sun.xml.internal.txw2.TypedXmlWriter
All known Subclasses: com.sun.xml.internal.txw2.ContainerElement,
TypedXmlWriter | public interface TypedXmlWriter (Code) | | Defines common operations for all typed XML writers.
Root of all typed XML writer interfaces.
This interface defines a series of methods to allow client applications
to write arbitrary well-formed documents.
author: Kohsuke Kawaguchi |
Method Summary | |
void | _attribute(String localName, Object value) Adds an attribute of the given name and the value. | void | _attribute(String nsUri, String localName, Object value) Adds an attribute of the given name and the value. | void | _attribute(QName attributeName, Object value) Adds an attribute of the given name and the value. | T | _cast(Class<T> targetInterface) Returns a different interface for this typed XML Writer.
Semantically, this operation is a 'cast' --- it returns the same underlying
writer in a different interface. | void | _cdata(Object value) Appends CDATA section. | void | _comment(Object value) Appends a comment. | T | _element(String localName, Class<T> contentModel) Appends a new child element. | T | _element(String nsUri, String localName, Class<T> contentModel) Appends a new child element. | T | _element(QName tagName, Class<T> contentModel) Appends a new child element. | T | _element(Class<T> contentModel) Appends a new child element.
This version of the _element method requires the T class to be
annotated with
XmlElement annotation. | void | _namespace(String uri) Declares a new namespace URI on this element. | void | _namespace(String uri, String prefix) Declares a new namespace URI on this element to
a specific prefix.
Parameters: uri - can be empty, but must not be null. Parameters: prefix - If non-empty, this prefix is bound to the URIon this element. | void | _namespace(String uri, boolean requirePrefix) Declares a new namespace URI on this element. | void | _pcdata(Object value) Appends text data. | void | block() Blocks the writing of the start tag so that
new attributes can be added even after child
elements are appended. | void | commit() Commits this element (and all its descendants) to the output. | void | commit(boolean includingAllPredecessors) Commits this element (and all its descendants) to the output.
Once a writer is committed, nothing can be added to it further.
Committing allows TXW to output a part of the document even
if the rest has not yet been written.
Parameters: includingAllPredecessors - if false, this operation will _commit this writer and all itsdescendants writers. | Document | getDocument() Gets the
Document object that this writer is writing to. |
_attribute | void _attribute(QName attributeName, Object value)(Code) | | Adds an attribute of the given name and the value.
Parameters: attributeName - must not be null. Parameters: value - value of the attribute.must not be null.See the documentation for the conversion rules. |
_cast | T _cast(Class<T> targetInterface)(Code) | | Returns a different interface for this typed XML Writer.
Semantically, this operation is a 'cast' --- it returns the same underlying
writer in a different interface. The returned new writer and the current writer
will write to the same element.
But this is different from Java's ordinary cast because the returned object
is not always the same as the current object.
always return non-null. |
_cdata | void _cdata(Object value)(Code) | | Appends CDATA section.
Parameters: value - must not be null.See the documentation for the conversion rules. |
_element | T _element(String nsUri, String localName, Class<T> contentModel)(Code) | | Appends a new child element.
The newly created child element is appended at the end of the children.
Parameters: nsUri - The namespace URI of the newly created element. Parameters: localName - The local name of the newly created element. Parameters: contentModel - The typed XML writer interface used to write the children ofthe new child element.always return non-null TypedXmlWriter that can be usedto write the contents of the newly created child element. |
_namespace | void _namespace(String uri)(Code) | | Declares a new namespace URI on this element.
The runtime system will assign an unique prefix for the URI.
Parameters: uri - can be empty, but must not be null. |
_namespace | void _namespace(String uri, String prefix)(Code) | | Declares a new namespace URI on this element to
a specific prefix.
Parameters: uri - can be empty, but must not be null. Parameters: prefix - If non-empty, this prefix is bound to the URIon this element. If empty, then the runtime will still try touse the URI as the default namespace, but it may fail to do sobecause of the constraints in the XML. throws: IllegalArgumentException - if the same prefix is already declared on this element. |
_namespace | void _namespace(String uri, boolean requirePrefix)(Code) | | Declares a new namespace URI on this element.
The runtime system will assign an unique prefix for the URI.
Parameters: uri - can be empty, but must not be null. Parameters: requirePrefix - if false, this method behaves just like TypedXmlWriter._namespace(String).if true, this guarantees that the URI is bound to a non empty prefix. |
_pcdata | void _pcdata(Object value)(Code) | | Appends text data.
Parameters: value - must not be null.See the documentation for the conversion rules. |
block | void block()(Code) | | Blocks the writing of the start tag so that
new attributes can be added even after child
elements are appended.
This blocks the output at the token before the start tag until
the
TypedXmlWriter.commit() method is called to _commit this element.
For more information, see the TXW documentation.
|
commit | void commit()(Code) | | Commits this element (and all its descendants) to the output.
Short for _commit(true).
|
commit | void commit(boolean includingAllPredecessors)(Code) | | Commits this element (and all its descendants) to the output.
Once a writer is committed, nothing can be added to it further.
Committing allows TXW to output a part of the document even
if the rest has not yet been written.
Parameters: includingAllPredecessors - if false, this operation will _commit this writer and all itsdescendants writers. If true, in addition to those writers,this operation will close all the writers before this writerin the document order. |
getDocument | Document getDocument()(Code) | | Gets the
Document object that this writer is writing to.
always non-null. |
|
|