|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XMLStreamWriter2
Extended interface that implements functionality that is necessary
to properly build event API on top of XMLStreamWriter
,
as well as to configure individual instances.
It also adds limited number of methods that are important for
efficient pass-through processing (such as one needed when routing
SOAP-messages).
Since version 3.0, stream writer will also implement "Typed Access API" on output side.
Method Summary | |
---|---|
void |
closeCompletely()
Method similar to XMLStreamWriter.close() ,
except that this method also does close the underlying output
destination (stream) if it has not yet been closed. |
void |
copyEventFromReader(XMLStreamReader2 r,
boolean preserveEventData)
Method that essentially copies event that the specified reader has just read. |
String |
getEncoding()
Method that can be called to get information about encoding that this writer is using (or at least claims is using). |
XMLStreamLocation2 |
getLocation()
Method that should return current output location, if the writer keeps track of it; null if it does not. |
boolean |
isPropertySupported(String name)
Method similar to XMLOutputFactory.isPropertySupported(java.lang.String) , used
to determine whether a property is supported by the Writer
instance. |
boolean |
setProperty(String name,
Object value)
Method that can be used to set per-writer properties; a subset of properties one can set via matching XMLOutputFactory2
instance. |
void |
writeCData(char[] text,
int start,
int len)
|
void |
writeDTD(String rootName,
String systemId,
String publicId,
String internalSubset)
|
void |
writeFullEndElement()
Method similar to XMLStreamWriter.writeEndElement() , but that will always
write the full end element, instead of empty element. |
void |
writeRaw(char[] text,
int offset,
int length)
Method that writes specified content as is, without encoding or deciphering it in any way. |
void |
writeRaw(String text)
Method that writes specified content as is, without encoding or deciphering it in any way. |
void |
writeRaw(String text,
int offset,
int length)
Method that writes specified content as is, without encoding or deciphering it in any way. |
void |
writeSpace(char[] text,
int offset,
int length)
Method that can be called to write whitespace-only content. |
void |
writeSpace(String text)
Method that can be called to write whitespace-only content. |
void |
writeStartDocument(String version,
String encoding,
boolean standAlone)
|
Methods inherited from interface javax.xml.stream.XMLStreamWriter |
---|
close, flush, getNamespaceContext, getPrefix, getProperty, setDefaultNamespace, setNamespaceContext, setPrefix, writeAttribute, writeAttribute, writeAttribute, writeCData, writeCharacters, writeCharacters, writeComment, writeDefaultNamespace, writeDTD, writeEmptyElement, writeEmptyElement, writeEmptyElement, writeEndDocument, writeEndElement, writeEntityRef, writeNamespace, writeProcessingInstruction, writeProcessingInstruction, writeStartDocument, writeStartDocument, writeStartDocument, writeStartElement, writeStartElement, writeStartElement |
Methods inherited from interface org.codehaus.stax2.validation.Validatable |
---|
setValidationProblemHandler, stopValidatingAgainst, stopValidatingAgainst, validateAgainst |
Method Detail |
---|
boolean isPropertySupported(String name)
XMLOutputFactory.isPropertySupported(java.lang.String)
, used
to determine whether a property is supported by the Writer
instance. This means that this method may return false
for some properties that the output factory does support: specifically,
it should only return true if the value is mutable on per-instance
basis. False means that either the property is not recognized, or
is not mutable via writer instance.
boolean setProperty(String name, Object value)
XMLOutputFactory2
instance. Exactly which methods are mutable is implementation
specific.
name
- Name of the property to setvalue
- Value to set property to.
InvalidArgumentException
- if the property is not supported
(or recognized) by the stream writer implementationXMLStreamLocation2 getLocation()
String getEncoding()
XMLOutputFactory
writeStartDocument
method (explicitly
or implicity; latter in cases where defaults are imposed
by Stax specification)
void writeCData(char[] text, int start, int len) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
void writeFullEndElement() throws javax.xml.stream.XMLStreamException
XMLStreamWriter.writeEndElement()
, but that will always
write the full end element, instead of empty element. This only
matters for cases where the element itself has no content, and
if writer is allowed to write empty elements when it encounters
such start/end element write pairs.
javax.xml.stream.XMLStreamException
void writeStartDocument(String version, String encoding, boolean standAlone) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
void writeSpace(String text) throws javax.xml.stream.XMLStreamException
This method is useful for things like outputting indentation.
javax.xml.stream.XMLStreamException
void writeSpace(char[] text, int offset, int length) throws javax.xml.stream.XMLStreamException
This method is useful for things like outputting indentation.
javax.xml.stream.XMLStreamException
void writeRaw(String text) throws javax.xml.stream.XMLStreamException
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.
javax.xml.stream.XMLStreamException
void writeRaw(String text, int offset, int length) throws javax.xml.stream.XMLStreamException
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.
javax.xml.stream.XMLStreamException
void writeRaw(char[] text, int offset, int length) throws javax.xml.stream.XMLStreamException
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.
javax.xml.stream.XMLStreamException
void copyEventFromReader(XMLStreamReader2 r, boolean preserveEventData) throws javax.xml.stream.XMLStreamException
r
- Reader to use for accessing event to copypreserveEventData
- 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.
javax.xml.stream.XMLStreamException
void closeCompletely() throws javax.xml.stream.XMLStreamException
XMLStreamWriter.close()
,
except that this method also does close the underlying output
destination (stream) if it has not yet been closed.
It is specifically necessary to call this method if the parsing ends
in an exception to ensure that the output destination does get
properly closed, even if the stream writer would otherwise close
it (as is the case for destinations it manages where calling
application has no access)
javax.xml.stream.XMLStreamException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |