XMLStreamWriter2,
the extended stream writer that is part of Stax2.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | copyEventFromReader(XMLStreamReader2
Reader to use for accessing event to copy sr, boolean If true, writer is not allowed to change
the state of the reader (so that all the data associated with the
current event has to be preserved); if false, writer is allowed
to use methods that may cause some data to be discarded. Setting
this to false may improve the performance, since it may allow
full no-copy streaming of data, especially textual contents. preserveEventData)Implements org. |
| protected void | |
| public abstract String | getEncoding()
Redeclares org. |
| public abstract XMLStreamLocation2 | getLocation()
Redeclares org. |
| public boolean | isPropertySupported(String name)
Implements org. javax., used
to determine whether a property is supported by the Writer
instance.
|
| public boolean | setProperty(String
Name of the property to set name, Object Value to set property to. value)Implements org. org.
instance.
|
| public ValidationProblemHandler | setValidationProblemHandler(ValidationProblemHandler
Handler to install, if non null; if null, indicates that
the default (implementation-specific) handling should be used h)Implements org. |
| public XMLValidator | stopValidatingAgainst(XMLValidationSchema schema)
Implements org. validateAgainst
was called earlier.
|
| public XMLValidator | stopValidatingAgainst(XMLValidator validator)
Implements org. |
| public XMLValidator | validateAgainst(XMLValidationSchema schema)
Implements org. XMLValidator instance from the
given schema (unless a validator for that schema has already been
added),
initialize it if necessary, and make validatable object (reader,
writer)
call appropriate validation methods from this point on until the
end of the document (that is, it's not scoped with sub-trees), or until
validator is removed by an explicit call to
stopValidatingAgainst.
|
| public void | writeCData(char[] text, int start, int len)
Implements org. |
| public void | |
| public void | writeFullEndElement()
Implements org. writeEndElement, but that will always
write the full end element, instead of empty element.
|
| public void | writeRaw(String text)
Implements org. |
| public abstract void | writeRaw(String text, int offset, int len)
Redeclares org. |
| public abstract void | writeRaw(char[] text, int offset, int length)
Redeclares org. |
| public void | writeSpace(String text)
Implements org. |
| public void | writeSpace(char[] text, int offset, int length)
Implements org. |
| public abstract void | writeStartDocument(String version, String encoding, boolean standAlone)
Redeclares org. |
| Stax2WriterImpl | back to summary |
|---|---|
| protected Stax2WriterImpl() | |
| copyEventFromReader | back to summary |
|---|---|
| public void copyEventFromReader(XMLStreamReader2 sr, boolean preserveEventData) throws XMLStreamException Implements org. Doc from org. Method that essentially copies event that the specified reader has just read. This can be both more convenient (no need to worry about details) and more efficient than separately calling access methods of the reader and write methods of the writer, since writer may know more about reader than the application (and may be able to use non-public methods)
| |
| copyStartElement | back to summary |
|---|---|
| protected void copyStartElement(XMLStreamReader sr) throws XMLStreamException Basic implementation of copy operation. It is likely that sub-classes can implement more efficient copy operations: if so, they should do so. | |
| getEncoding | back to summary |
|---|---|
| public abstract String getEncoding() Redeclares org. Doc from org. Method that can be called to get information about encoding that this writer is using (or at least claims is using). That is, it returns name of encoding specified when (in order of priority):
| |
| getLocation | back to summary |
|---|---|
| public abstract XMLStreamLocation2 getLocation() Redeclares org. Doc from org. Method that should return current output location, if the writer keeps track of it; null if it does not.
| |
| isPropertySupported | back to summary |
|---|---|
| public boolean isPropertySupported(String name) Implements org. Doc from org. Method similar to
| |
| setProperty | back to summary |
|---|---|
| public boolean setProperty(String name, Object value) Implements org. Doc from org. Method that can be used to set per-writer properties; a subset of
properties one can set via matching
| |
| setValidationProblemHandler | back to summary |
|---|---|
| public ValidationProblemHandler setValidationProblemHandler(ValidationProblemHandler h) Implements org. Doc from org. Method that application can call to define a custom handler for validation problems encountered during validation process.
| |
| stopValidatingAgainst | back to summary |
|---|---|
| public XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException Implements org. Doc from org. Method that can be called by application to stop validating
output against a schema, for which
| |
| stopValidatingAgainst | back to summary |
|---|---|
| public XMLValidator stopValidatingAgainst(XMLValidator validator) throws XMLStreamException Implements org. Doc from org. Method that can be called by application to stop validating
output using specified validator. The validator passed should be
an earlier return value for a call to Note the specified validator is compared for identity with validators in use, not for equality.
| |
| validateAgainst | back to summary |
|---|---|
| public XMLValidator validateAgainst(XMLValidationSchema schema) throws XMLStreamException Implements org. Doc from org. Method that will construct a Note that while this method can be called at any point in output processing, validator instances are not required to be able to handle addition at other points than right before outputting the root element.
| |
| writeCData | back to summary |
|---|---|
| public void writeCData(char[] text, int start, int len) throws XMLStreamException Implements org.
| |
| writeDTD | back to summary |
|---|---|
| public void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws XMLStreamException Implements org.
| |
| writeFullEndElement | back to summary |
|---|---|
| public void writeFullEndElement() throws XMLStreamException Implements org. Doc from org. Method similar to
| |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(String text) throws XMLStreamException Implements org. Doc from org. Method that writes specified content as is, without encoding or deciphering it in any way. It will not update state of the writer (except by possibly flushing output of previous writes, like finishing a start element), nor be validated in any way. As such, care must be taken, if this method is used. Method is usually used when encapsulating output from another writer as a sub-tree, or when passing through XML fragments. Note since text to be written may be anything, including markup, it can not be reliably validated. Because of this, validator(s) attached to the writer will NOT be informed about writes.
| |
| writeRaw | back to summary |
|---|---|
| public abstract void writeRaw(String text, int offset, int len) throws XMLStreamException Redeclares org. Doc from org. Method that writes specified content as is, without encoding or deciphering it in any way. It will not update state of the writer (except by possibly flushing output of previous writes, like finishing a start element), nor be validated in any way. As such, care must be taken, if this method is used. Method is usually used when encapsulating output from another writer as a sub-tree, or when passing through XML fragments. Note since text to be written may be anything, including markup, it can not be reliably validated. Because of this, validator(s) attached to the writer will NOT be informed about writes.
| |
| writeRaw | back to summary |
|---|---|
| public abstract void writeRaw(char[] text, int offset, int length) throws XMLStreamException Redeclares org. Doc from org. Method that writes specified content as is, without encoding or deciphering it in any way. It will not update state of the writer (except by possibly flushing output of previous writes, like finishing a start element), nor be validated in any way. As such, care must be taken, if this method is used. Method is usually used when encapsulating output from another writer as a sub-tree, or when passing through XML fragments. Note since text to be written may be anything, including markup, it can not be reliably validated. Because of this, validator(s) attached to the writer will NOT be informed about writes.
| |
| writeSpace | back to summary |
|---|---|
| public void writeSpace(String text) throws XMLStreamException Implements org. Doc from org. Method that can be called to write whitespace-only content. If so, it is to be written as is (with no escaping), and does not contain non-whitespace characters (writer may validate this, and throw an exception if it does). This method is useful for things like outputting indentation.
| |
| writeSpace | back to summary |
|---|---|
| public void writeSpace(char[] text, int offset, int length) throws XMLStreamException Implements org. Doc from org. Method that can be called to write whitespace-only content. If so, it is to be written as is (with no escaping), and does not contain non-whitespace characters (writer may validate this, and throw an exception if it does). This method is useful for things like outputting indentation.
| |
| writeStartDocument | back to summary |
|---|---|
| public abstract void writeStartDocument(String version, String encoding, boolean standAlone) throws XMLStreamException Redeclares org.
| |