public abstract class Stax2WriterImpl extends Object implements XMLStreamWriter2, XMLStreamConstants
XMLStreamWriter2,
 the extended stream writer that is part of Stax2.ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT| Modifier | Constructor and Description | 
|---|---|
protected  | 
Stax2WriterImpl()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
copyEventFromReader(XMLStreamReader2 sr,
                   boolean preserveEventData)
Method that essentially copies
 event that the specified reader has just read. 
 | 
protected void | 
copyStartElement(XMLStreamReader sr)
Basic implementation of copy operation. 
 | 
abstract String | 
getEncoding()
Method that can be called to get information about encoding that
 this writer is using (or at least claims is using). 
 | 
abstract 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. | 
ValidationProblemHandler | 
setValidationProblemHandler(ValidationProblemHandler h)
Method that application can call to define a custom handler for
 validation problems encountered during validation process. 
 | 
XMLValidator | 
stopValidatingAgainst(XMLValidationSchema schema)
Method that can be called by application to stop validating
 output against a schema, for which  
Validatable.validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema)
 was called earlier. | 
XMLValidator | 
stopValidatingAgainst(XMLValidator validator)
Method that can be called by application to stop validating
 output using specified validator. 
 | 
XMLValidator | 
validateAgainst(XMLValidationSchema schema)
Method that will construct a  
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
 Validatable.stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema). | 
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. | 
abstract 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. 
 | 
abstract void | 
writeRaw(String text,
        int offset,
        int len)
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. 
 | 
abstract void | 
writeStartDocument(String version,
                  String encoding,
                  boolean standAlone)  | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloseCompletelywriteBinary, writeBinary, writeBinaryAttribute, writeBinaryAttribute, writeBoolean, writeBooleanAttribute, writeDecimal, writeDecimalAttribute, writeDouble, writeDoubleArray, writeDoubleArrayAttribute, writeDoubleAttribute, writeFloat, writeFloatArray, writeFloatArrayAttribute, writeFloatAttribute, writeInt, writeIntArray, writeIntArrayAttribute, writeIntAttribute, writeInteger, writeIntegerAttribute, writeLong, writeLongArray, writeLongArrayAttribute, writeLongAttribute, writeQName, writeQNameAttributeclose, 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, writeStartElementpublic boolean isPropertySupported(String name)
XMLStreamWriter2XMLOutputFactory.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.isPropertySupported in interface XMLStreamWriter2public boolean setProperty(String name, Object value)
XMLStreamWriter2XMLOutputFactory2
 instance. Exactly which methods are mutable is implementation
 specific.setProperty in interface XMLStreamWriter2name - Name of the property to setvalue - Value to set property to.public abstract XMLStreamLocation2 getLocation()
XMLStreamWriter2getLocation in interface XMLStreamWriter2public abstract String getEncoding()
XMLStreamWriter2XMLOutputFactory
  writeStartDocument method (explicitly
   or implicity; latter in cases where defaults are imposed
   by Stax specification)
  getEncoding in interface XMLStreamWriter2public void writeCData(char[] text,
              int start,
              int len)
                throws XMLStreamException
writeCData in interface XMLStreamWriter2XMLStreamExceptionpublic void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws XMLStreamException
writeDTD in interface XMLStreamWriter2XMLStreamExceptionpublic void writeFullEndElement()
                         throws XMLStreamException
XMLStreamWriter2XMLStreamWriter.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.writeFullEndElement in interface XMLStreamWriter2XMLStreamExceptionpublic void writeSpace(String text) throws XMLStreamException
XMLStreamWriter2This method is useful for things like outputting indentation.
writeSpace in interface XMLStreamWriter2XMLStreamExceptionpublic void writeSpace(char[] text,
              int offset,
              int length)
                throws XMLStreamException
XMLStreamWriter2This method is useful for things like outputting indentation.
writeSpace in interface XMLStreamWriter2XMLStreamExceptionpublic abstract void writeStartDocument(String version, String encoding, boolean standAlone) throws XMLStreamException
writeStartDocument in interface XMLStreamWriter2XMLStreamExceptionpublic void writeRaw(String text) throws XMLStreamException
XMLStreamWriter2Method 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 in interface XMLStreamWriter2XMLStreamExceptionpublic abstract void writeRaw(String text, int offset, int len) throws XMLStreamException
XMLStreamWriter2Method 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 in interface XMLStreamWriter2XMLStreamExceptionpublic abstract void writeRaw(char[] text,
            int offset,
            int length)
                       throws XMLStreamException
XMLStreamWriter2Method 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 in interface XMLStreamWriter2XMLStreamExceptionpublic void copyEventFromReader(XMLStreamReader2 sr, boolean preserveEventData) throws XMLStreamException
XMLStreamWriter2copyEventFromReader in interface XMLStreamWriter2sr - 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.XMLStreamExceptionpublic XMLValidator validateAgainst(XMLValidationSchema schema) throws XMLStreamException
ValidatableXMLValidator 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
 Validatable.stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema).
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.
validateAgainst in interface ValidatableXMLStreamExceptionpublic XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException
ValidatableValidatable.validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema)
 was called earlier.stopValidatingAgainst in interface ValidatableXMLStreamExceptionpublic XMLValidator stopValidatingAgainst(XMLValidator validator) throws XMLStreamException
ValidatableValidatable.validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema).
Note: the specified validator is compared for identity with validators in use, not for equality.
stopValidatingAgainst in interface Validatablevalidator)
   if it was being used for validating current document; null if not.XMLStreamExceptionpublic ValidationProblemHandler setValidationProblemHandler(ValidationProblemHandler h)
ValidatablesetValidationProblemHandler in interface Validatableh - Handler to install, if non null; if null, indicates that
   the default (implementation-specific) handling should be usedprotected void copyStartElement(XMLStreamReader sr) throws XMLStreamException
XMLStreamExceptionCopyright © 2015 fasterxml.com. All Rights Reserved.