Class StreamWriterBase
java.lang.Object
org.codehaus.stax2.ri.Stax2WriterImpl
com.fasterxml.aalto.out.StreamWriterBase
- All Implemented Interfaces:
NamespaceContext, XMLStreamConstants, XMLStreamWriter, org.codehaus.stax2.typed.TypedXMLStreamWriter, org.codehaus.stax2.validation.Validatable, org.codehaus.stax2.validation.ValidationContext, org.codehaus.stax2.XMLStreamWriter2
- Direct Known Subclasses:
NonRepairingStreamWriter, RepairingStreamWriter
public abstract class StreamWriterBase
extends org.codehaus.stax2.ri.Stax2WriterImpl
implements NamespaceContext, org.codehaus.stax2.validation.ValidationContext
Base class for
XMLStreamReader implementations.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected booleanprotected booleanprotected booleanprotected final WriterConfigprotected OutputElementWe'll use a virtual root element (like a document node of sort), to simplify other processing, basically such that there is always a current output element instance, even when in prolog or epilog.protected StringValue passed as the expected root element, when using the multiple argumentwriteDTD(String)method.protected OutputElementprotected intprotected NamespaceContextRoot namespace context defined for this writer, if any.protected StreamWriterBase.Stateprotected booleanFlag that is set to true first time something has been output.protected booleanFlag that indicates that current element is an empty element (one that is explicitly defined as one, by calling a method -- NOT one that just happens to be empty).protected booleanFlag that is set during time that a start element is "open", ie.protected WNameTableprotected org.codehaus.stax2.validation.XMLValidatorOptional validator to use for validating output against one or more schemas, and/or for safe pretty-printing (indentation).protected org.codehaus.stax2.ri.typed.ValueEncoderFactoryWhen outputting using Typed Access API, we will need encoders.protected intState value used with validation, to track types of content that is allowed at this point in output stream.protected org.codehaus.stax2.validation.ValidationProblemHandlerCustom validation problem handler, if any.protected final XmlWriterActual physical writer to output serialized XML content to(package private) static final intAlthough pooled objects are small, let's limit the pool size nonetheless, to minimize extra memory usage for deeply nested documents.Fields inherited from interface XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStreamWriterBase(WriterConfig cfg, XmlWriter writer, WNameTable symbols) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_closeStartElement(boolean emptyElem) Method called to close an open start element, when another main-level element (not namespace declaration or attribute) is being output; except for end element which is handled differently.private final void_finishDocument(boolean forceRealClose) protected void_reportInvalidContent(int evtType) protected static void_reportNwfAttr(String msg) This is the method called when an output method call violates attribute well-formedness checks (trying to output dup attrs) and name validaty checking is enabled.protected static void_reportNwfAttr(String msg, Object arg) protected static void_reportNwfContent(String msg) This is the method called when an output method call violates content well-formedness checks and content validation is enabled.protected static void_reportNwfContent(String msg, Object arg) protected static void_reportNwfName(String msg) protected static voidThis is the method called when an output method call violates structural well-formedness checks and structural checking is enabled.protected static void_reportNwfStructure(String msg, Object arg) voidprotected abstract String_serializeQName(QName name) protected abstract void_setPrefix(String prefix, String uri) protected void_verifyRootElement(String prefix, String localName) protected void_verifyStartElement(String prefix, String localName) Method that is called to ensure that we can start writing an element, both from structural point of view, and from syntactic (close previously open start element, if any).protected final void_verifyWriteAttr(WName name) protected final voidprotected final voidprotected final void_writeAttribute(WName name, String value) protected final void_writeAttribute(WName name, org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) protected final voidprotected final void_writeNamespace(String prefix, String uri) protected void_writeStartDocument(String version, String encoding, String standAlone) protected void_writeStartTag(WName name, boolean isEmpty) protected void_writeStartTag(WName name, boolean isEmpty, String uri) intaddDefaultAttribute(String localName, String uri, String prefix, String value) Adding default attribute values does not usually make sense on output side, so the implementation is a NOP for now.voidclose()voidintfindAttributeIndex(String nsURI, String localName) voidflush()intgetAttributeLocalName(int index) getAttributeNamespace(int index) getAttributePrefix(int index) getAttributeType(int index) getAttributeValue(int index) getAttributeValue(String nsURI, String localName) As of now, there is no way to specify the base URI.org.codehaus.stax2.XMLStreamLocation2final NamespaceContextgetNamespaceURI(String prefix) getPrefixes(String uri) getProperty(String name) protected final booleanbooleanisNotationDeclared(String name) booleanisPropertySupported(String name) booleanprotected static voidreportIllegalArg(String msg) protected static voidMethod called when an illegal method (namespace-specific method on non-ns writer) is called by the application.voidreportProblem(org.codehaus.stax2.validation.XMLValidationProblem prob) private voidabstract voidvoidfinal voidbooleansetProperty(String name, Object value) org.codehaus.stax2.validation.ValidationProblemHandlersetValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h) org.codehaus.stax2.validation.XMLValidatorstopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) org.codehaus.stax2.validation.XMLValidatorstopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator) protected static voidthrowFromIOE(IOException ioe) protected static voidthrowOutputError(String msg) protected static voidthrowOutputError(String format, Object arg) toString()org.codehaus.stax2.validation.XMLValidatorvalidateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) protected final org.codehaus.stax2.ri.typed.ValueEncoderFactoryfinal voidwriteAttribute(String localName, String value) abstract voidwriteAttribute(String nsURI, String localName, String value) abstract voidwriteAttribute(String prefix, String nsURI, String localName, String value) voidwriteBinary(byte[] value, int from, int length) voidwriteBinary(org.codehaus.stax2.typed.Base64Variant v, byte[] value, int from, int length) voidwriteBinaryAttribute(String prefix, String nsURI, String localName, byte[] value) voidwriteBinaryAttribute(org.codehaus.stax2.typed.Base64Variant v, String prefix, String nsURI, String localName, byte[] value) voidwriteBoolean(boolean b) final voidwriteBooleanAttribute(String prefix, String nsURI, String localName, boolean value) voidwriteCData(char[] cbuf, int start, int len) voidwriteCData(String data) voidwriteCharacters(char[] text, int start, int len) voidwriteCharacters(String text) voidwriteComment(String data) voidwriteDecimal(BigDecimal value) final voidwriteDecimalAttribute(String prefix, String nsURI, String localName, BigDecimal value) abstract voidwriteDefaultNamespace(String nsURI) voidwriteDouble(double value) voidwriteDoubleArray(double[] value, int from, int length) voidwriteDoubleArrayAttribute(String prefix, String nsURI, String localName, double[] value) final voidwriteDoubleAttribute(String prefix, String nsURI, String localName, double value) final voidvoidvoidwriteDTD(org.codehaus.stax2.DTDInfo info) voidwriteEmptyElement(String localName) It is assumed here that caller actually wants whatever is the default namespace (or it is used in "non-namespace" mode, where no namespaces are bound ever).abstract voidwriteEmptyElement(String nsURI, String localName) abstract voidwriteEmptyElement(String prefix, String localName, String nsURI) voidvoidvoidwriteEntityRef(String name) voidwriteFloat(float value) voidwriteFloatArray(float[] value, int from, int length) voidwriteFloatArrayAttribute(String prefix, String nsURI, String localName, float[] value) final voidwriteFloatAttribute(String prefix, String nsURI, String localName, float value) voidSimilar towriteEndElement(), but never allows implicit creation of empty elements.voidwriteInt(int value) final voidwriteIntArray(int[] value, int from, int length) voidwriteIntArrayAttribute(String prefix, String nsURI, String localName, int[] value) final voidwriteIntAttribute(String prefix, String nsURI, String localName, int value) voidwriteInteger(BigInteger value) final voidwriteIntegerAttribute(String prefix, String nsURI, String localName, BigInteger value) voidwriteLong(long value) voidwriteLongArray(long[] value, int from, int length) voidwriteLongArrayAttribute(String prefix, String nsURI, String localName, long[] value) final voidwriteLongAttribute(String prefix, String nsURI, String localName, long value) abstract voidwriteNamespace(String prefix, String nsURI) voidwriteProcessingInstruction(String target) voidwriteProcessingInstruction(String target, String data) voidwriteQName(QName value) final voidwriteQNameAttribute(String prefix, String nsURI, String localName, QName value) voidwriteRaw(char[] text, int offset, int length) voidvoidvoidwriteSpace(char[] cbuf, int offset, int len) voidwriteSpace(String text) voidvoidwriteStartDocument(String version) voidwriteStartDocument(String encoding, String version) voidwriteStartDocument(String version, String encoding, boolean standAlone) voidwriteStartElement(String localName) It is assumed here that caller actually wants whatever is the default namespace (or it is used in "non-namespace" mode, where no namespaces are bound ever).abstract voidwriteStartElement(String nsURI, String localName) abstract voidwriteStartElement(String prefix, String localName, String nsURI) abstract voidwriteTypedAttribute(String prefix, String nsURI, String localName, org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) Need to leave implementation of this method abstract, because repairing and non-repairing modes differ in how names are handled.private final voidwriteTypedElement(org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) Methods inherited from class org.codehaus.stax2.ri.Stax2WriterImpl
copyEventFromReader, copyStartElement
-
Field Details
-
_config
-
_rootNsContext
Root namespace context defined for this writer, if any. -
_cfgCheckStructure
protected boolean _cfgCheckStructure -
_cfgCheckContent
protected boolean _cfgCheckContent -
_cfgCheckAttrs
protected boolean _cfgCheckAttrs -
_cfgCDataAsText
protected final boolean _cfgCDataAsText -
_symbols
-
_xmlWriter
Actual physical writer to output serialized XML content to -
_valueEncoderFactory
protected org.codehaus.stax2.ri.typed.ValueEncoderFactory _valueEncoderFactoryWhen outputting using Typed Access API, we will need encoders. If so, they will created by lazily-constructed factory -
_validator
protected org.codehaus.stax2.validation.XMLValidator _validatorOptional validator to use for validating output against one or more schemas, and/or for safe pretty-printing (indentation). -
_vldContent
protected int _vldContentState value used with validation, to track types of content that is allowed at this point in output stream. Only used if validation is enabled: if so, value is determined via validation callbacks. -
_vldProblemHandler
protected org.codehaus.stax2.validation.ValidationProblemHandler _vldProblemHandlerCustom validation problem handler, if any. -
_state
-
_currElem
We'll use a virtual root element (like a document node of sort), to simplify other processing, basically such that there is always a current output element instance, even when in prolog or epilog. -
_stateAnyOutput
protected boolean _stateAnyOutputFlag that is set to true first time something has been output. Generally needed to keep track of whether XML declaration (START_DOCUMENT) can be output or not. -
_stateStartElementOpen
protected boolean _stateStartElementOpenFlag that is set during time that a start element is "open", ie. START_ELEMENT has been output (and possibly zero or more name space declarations and attributes), before other main-level constructs have been output. -
_stateEmptyElement
protected boolean _stateEmptyElementFlag that indicates that current element is an empty element (one that is explicitly defined as one, by calling a method -- NOT one that just happens to be empty). This is needed to know what to do when next non-ns/attr node is output; normally a new context is opened, but for empty elements not. -
_dtdRootElemName
Value passed as the expected root element, when using the multiple argumentwriteDTD(String)method. Will be used in structurally validating mode (and in dtd-validating mode, since that automatically enables structural validation as well, to pre-filter well-formedness errors that validators might have trouble dealing with). -
_outputElemPool
-
MAX_POOL_SIZE
static final int MAX_POOL_SIZEAlthough pooled objects are small, let's limit the pool size nonetheless, to minimize extra memory usage for deeply nested documents. Even just 4 levels might be enough, 8 should cover > 95% of cases- See Also:
-
_poolSize
protected int _poolSize
-
-
Constructor Details
-
StreamWriterBase
-
-
Method Details
-
close
- Specified by:
closein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
flush
- Specified by:
flushin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
getNamespaceContext
- Specified by:
getNamespaceContextin interfaceXMLStreamWriter
-
getProperty
- Specified by:
getPropertyin interfaceXMLStreamWriter
-
setDefaultNamespace
- Specified by:
setDefaultNamespacein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
setNamespaceContext
- Specified by:
setNamespaceContextin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
setPrefix
- Specified by:
setPrefixin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
_setPrefix
-
writeAttribute
- Specified by:
writeAttributein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeAttribute
public abstract void writeAttribute(String nsURI, String localName, String value) throws XMLStreamException - Specified by:
writeAttributein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeAttribute
public abstract void writeAttribute(String prefix, String nsURI, String localName, String value) throws XMLStreamException - Specified by:
writeAttributein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeCData
- Specified by:
writeCDatain interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeCharacters
- Specified by:
writeCharactersin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeCharacters
- Specified by:
writeCharactersin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeComment
- Specified by:
writeCommentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeDefaultNamespace
- Specified by:
writeDefaultNamespacein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeDTD
- Specified by:
writeDTDin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEmptyElement
It is assumed here that caller actually wants whatever is the default namespace (or it is used in "non-namespace" mode, where no namespaces are bound ever). As such we do not have to distinguish between repairing and non-repairing modes.- Specified by:
writeEmptyElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEmptyElement
- Specified by:
writeEmptyElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEmptyElement
public abstract void writeEmptyElement(String prefix, String localName, String nsURI) throws XMLStreamException - Specified by:
writeEmptyElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEndDocument
- Specified by:
writeEndDocumentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEndElement
- Specified by:
writeEndElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEntityRef
- Specified by:
writeEntityRefin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeNamespace
- Specified by:
writeNamespacein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeProcessingInstruction
- Specified by:
writeProcessingInstructionin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeProcessingInstruction
- Specified by:
writeProcessingInstructionin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartDocument
- Specified by:
writeStartDocumentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartDocument
- Specified by:
writeStartDocumentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartDocument
- Specified by:
writeStartDocumentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartElement
It is assumed here that caller actually wants whatever is the default namespace (or it is used in "non-namespace" mode, where no namespaces are bound ever). As such we do not have to distinguish between repairing and non-repairing modes.- Specified by:
writeStartElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartElement
- Specified by:
writeStartElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartElement
public abstract void writeStartElement(String prefix, String localName, String nsURI) throws XMLStreamException - Specified by:
writeStartElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNamespaceContext- Specified by:
getNamespaceURIin interfaceorg.codehaus.stax2.validation.ValidationContext
-
getPrefix
- Specified by:
getPrefixin interfaceNamespaceContext- Specified by:
getPrefixin interfaceXMLStreamWriter
-
getPrefixes
- Specified by:
getPrefixesin interfaceNamespaceContext
-
writeBoolean
- Specified by:
writeBooleanin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeInt
- Specified by:
writeIntin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeLong
- Specified by:
writeLongin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeFloat
- Specified by:
writeFloatin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeDouble
- Specified by:
writeDoublein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeInteger
- Specified by:
writeIntegerin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeDecimal
- Specified by:
writeDecimalin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeQName
- Specified by:
writeQNamein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeIntArray
- Specified by:
writeIntArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeLongArray
- Specified by:
writeLongArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeFloatArray
- Specified by:
writeFloatArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeDoubleArray
- Specified by:
writeDoubleArrayin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeBinary
- Specified by:
writeBinaryin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeBinary
public void writeBinary(org.codehaus.stax2.typed.Base64Variant v, byte[] value, int from, int length) throws XMLStreamException - Specified by:
writeBinaryin interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeTypedElement
private final void writeTypedElement(org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) throws XMLStreamException - Throws:
XMLStreamException
-
writeBooleanAttribute
public final void writeBooleanAttribute(String prefix, String nsURI, String localName, boolean value) throws XMLStreamException - Specified by:
writeBooleanAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeIntAttribute
public final void writeIntAttribute(String prefix, String nsURI, String localName, int value) throws XMLStreamException - Specified by:
writeIntAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeLongAttribute
public final void writeLongAttribute(String prefix, String nsURI, String localName, long value) throws XMLStreamException - Specified by:
writeLongAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeFloatAttribute
public final void writeFloatAttribute(String prefix, String nsURI, String localName, float value) throws XMLStreamException - Specified by:
writeFloatAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeDoubleAttribute
public final void writeDoubleAttribute(String prefix, String nsURI, String localName, double value) throws XMLStreamException - Specified by:
writeDoubleAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeIntegerAttribute
public final void writeIntegerAttribute(String prefix, String nsURI, String localName, BigInteger value) throws XMLStreamException - Specified by:
writeIntegerAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeDecimalAttribute
public final void writeDecimalAttribute(String prefix, String nsURI, String localName, BigDecimal value) throws XMLStreamException - Specified by:
writeDecimalAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeQNameAttribute
public final void writeQNameAttribute(String prefix, String nsURI, String localName, QName value) throws XMLStreamException - Specified by:
writeQNameAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeIntArrayAttribute
public void writeIntArrayAttribute(String prefix, String nsURI, String localName, int[] value) throws XMLStreamException - Specified by:
writeIntArrayAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeLongArrayAttribute
public void writeLongArrayAttribute(String prefix, String nsURI, String localName, long[] value) throws XMLStreamException - Specified by:
writeLongArrayAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeFloatArrayAttribute
public void writeFloatArrayAttribute(String prefix, String nsURI, String localName, float[] value) throws XMLStreamException - Specified by:
writeFloatArrayAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeDoubleArrayAttribute
public void writeDoubleArrayAttribute(String prefix, String nsURI, String localName, double[] value) throws XMLStreamException - Specified by:
writeDoubleArrayAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeBinaryAttribute
public void writeBinaryAttribute(String prefix, String nsURI, String localName, byte[] value) throws XMLStreamException - Specified by:
writeBinaryAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeBinaryAttribute
public void writeBinaryAttribute(org.codehaus.stax2.typed.Base64Variant v, String prefix, String nsURI, String localName, byte[] value) throws XMLStreamException - Specified by:
writeBinaryAttributein interfaceorg.codehaus.stax2.typed.TypedXMLStreamWriter- Throws:
XMLStreamException
-
writeTypedAttribute
public abstract void writeTypedAttribute(String prefix, String nsURI, String localName, org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) throws XMLStreamException Need to leave implementation of this method abstract, because repairing and non-repairing modes differ in how names are handled.- Throws:
XMLStreamException
-
_serializeQName
- Throws:
XMLStreamException
-
writeSpace
- Specified by:
writeSpacein interfaceorg.codehaus.stax2.XMLStreamWriter2- Overrides:
writeSpacein classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
writeSpace
- Specified by:
writeSpacein interfaceorg.codehaus.stax2.XMLStreamWriter2- Overrides:
writeSpacein classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
closeCompletely
- Specified by:
closeCompletelyin interfaceorg.codehaus.stax2.XMLStreamWriter2- Throws:
XMLStreamException
-
isPropertySupported
- Specified by:
isPropertySupportedin interfaceorg.codehaus.stax2.XMLStreamWriter2- Overrides:
isPropertySupportedin classorg.codehaus.stax2.ri.Stax2WriterImpl
-
setProperty
- Specified by:
setPropertyin interfaceorg.codehaus.stax2.XMLStreamWriter2- Overrides:
setPropertyin classorg.codehaus.stax2.ri.Stax2WriterImpl- Parameters:
name- Name of the property to setvalue- Value to set property to.- Returns:
- True, if the specified property was succesfully set to specified value; false if its value was not changed
-
validateAgainst
public org.codehaus.stax2.validation.XMLValidator validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) throws XMLStreamException - Specified by:
validateAgainstin interfaceorg.codehaus.stax2.validation.Validatable- Overrides:
validateAgainstin classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
stopValidatingAgainst
public org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) throws XMLStreamException - Specified by:
stopValidatingAgainstin interfaceorg.codehaus.stax2.validation.Validatable- Overrides:
stopValidatingAgainstin classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
stopValidatingAgainst
public org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator) throws XMLStreamException - Specified by:
stopValidatingAgainstin interfaceorg.codehaus.stax2.validation.Validatable- Overrides:
stopValidatingAgainstin classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
setValidationProblemHandler
public org.codehaus.stax2.validation.ValidationProblemHandler setValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h) - Specified by:
setValidationProblemHandlerin interfaceorg.codehaus.stax2.validation.Validatable- Overrides:
setValidationProblemHandlerin classorg.codehaus.stax2.ri.Stax2WriterImpl
-
resetValidationFlags
private void resetValidationFlags() -
getLocation
public org.codehaus.stax2.XMLStreamLocation2 getLocation()- Specified by:
getLocationin interfaceorg.codehaus.stax2.XMLStreamWriter2- Specified by:
getLocationin classorg.codehaus.stax2.ri.Stax2WriterImpl
-
getEncoding
- Specified by:
getEncodingin interfaceorg.codehaus.stax2.XMLStreamWriter2- Specified by:
getEncodingin classorg.codehaus.stax2.ri.Stax2WriterImpl
-
writeCData
- Specified by:
writeCDatain interfaceorg.codehaus.stax2.XMLStreamWriter2- Overrides:
writeCDatain classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
writeDTD
- Throws:
XMLStreamException
-
writeDTD
public void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws XMLStreamException - Specified by:
writeDTDin interfaceorg.codehaus.stax2.XMLStreamWriter2- Overrides:
writeDTDin classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
writeFullEndElement
Similar towriteEndElement(), but never allows implicit creation of empty elements.- Specified by:
writeFullEndElementin interfaceorg.codehaus.stax2.XMLStreamWriter2- Overrides:
writeFullEndElementin classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
writeStartDocument
public void writeStartDocument(String version, String encoding, boolean standAlone) throws XMLStreamException - Specified by:
writeStartDocumentin interfaceorg.codehaus.stax2.XMLStreamWriter2- Specified by:
writeStartDocumentin classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
writeRaw
- Specified by:
writeRawin interfaceorg.codehaus.stax2.XMLStreamWriter2- Overrides:
writeRawin classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
writeRaw
- Specified by:
writeRawin interfaceorg.codehaus.stax2.XMLStreamWriter2- Specified by:
writeRawin classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
writeRaw
- Specified by:
writeRawin interfaceorg.codehaus.stax2.XMLStreamWriter2- Specified by:
writeRawin classorg.codehaus.stax2.ri.Stax2WriterImpl- Throws:
XMLStreamException
-
getXmlVersion
- Specified by:
getXmlVersionin interfaceorg.codehaus.stax2.validation.ValidationContext
-
getCurrentElementName
- Specified by:
getCurrentElementNamein interfaceorg.codehaus.stax2.validation.ValidationContext
-
getBaseUri
As of now, there is no way to specify the base URI. Could be improved in future, if xml:base is supported.- Specified by:
getBaseUriin interfaceorg.codehaus.stax2.validation.ValidationContext
-
getValidationLocation
- Specified by:
getValidationLocationin interfaceorg.codehaus.stax2.validation.ValidationContext
-
reportProblem
public void reportProblem(org.codehaus.stax2.validation.XMLValidationProblem prob) throws XMLStreamException - Specified by:
reportProblemin interfaceorg.codehaus.stax2.validation.ValidationContext- Throws:
XMLStreamException
-
addDefaultAttribute
Adding default attribute values does not usually make sense on output side, so the implementation is a NOP for now.- Specified by:
addDefaultAttributein interfaceorg.codehaus.stax2.validation.ValidationContext
-
isNotationDeclared
- Specified by:
isNotationDeclaredin interfaceorg.codehaus.stax2.validation.ValidationContext
-
isUnparsedEntityDeclared
- Specified by:
isUnparsedEntityDeclaredin interfaceorg.codehaus.stax2.validation.ValidationContext
-
getAttributeCount
public int getAttributeCount()- Specified by:
getAttributeCountin interfaceorg.codehaus.stax2.validation.ValidationContext
-
getAttributeLocalName
- Specified by:
getAttributeLocalNamein interfaceorg.codehaus.stax2.validation.ValidationContext
-
getAttributeNamespace
- Specified by:
getAttributeNamespacein interfaceorg.codehaus.stax2.validation.ValidationContext
-
getAttributePrefix
- Specified by:
getAttributePrefixin interfaceorg.codehaus.stax2.validation.ValidationContext
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceorg.codehaus.stax2.validation.ValidationContext
-
getAttributeValue
-
getAttributeType
- Specified by:
getAttributeTypein interfaceorg.codehaus.stax2.validation.ValidationContext
-
findAttributeIndex
-
_closeStartElement
Method called to close an open start element, when another main-level element (not namespace declaration or attribute) is being output; except for end element which is handled differently.- Throws:
XMLStreamException
-
inPrologOrEpilog
protected final boolean inPrologOrEpilog() -
valueEncoderFactory
protected final org.codehaus.stax2.ri.typed.ValueEncoderFactory valueEncoderFactory() -
_writeAttribute
- Throws:
XMLStreamException
-
_writeAttribute
protected final void _writeAttribute(WName name, org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) throws XMLStreamException - Throws:
XMLStreamException
-
_writeDefaultNamespace
- Throws:
XMLStreamException
-
_writeNamespace
- Throws:
XMLStreamException
-
_writeStartDocument
protected void _writeStartDocument(String version, String encoding, String standAlone) throws XMLStreamException - Throws:
XMLStreamException
-
_writeStartTag
- Throws:
XMLStreamException
-
_writeStartTag
- Throws:
XMLStreamException
-
_verifyWriteAttr
-
_verifyStartElement
Method that is called to ensure that we can start writing an element, both from structural point of view, and from syntactic (close previously open start element, if any). Note that since it needs to be called before writing out anything, no namespace bindings have been (or can be) output, and hence given prefix may not be one that actually gets used.- Throws:
XMLStreamException
-
_verifyWriteCData
- Throws:
XMLStreamException
-
_verifyWriteDTD
- Throws:
XMLStreamException
-
_verifyRootElement
-
throwOutputError
- Throws:
XMLStreamException
-
throwOutputError
- Throws:
XMLStreamException
-
reportIllegalMethod
Method called when an illegal method (namespace-specific method on non-ns writer) is called by the application.- Throws:
XMLStreamException
-
_reportNwfStructure
This is the method called when an output method call violates structural well-formedness checks and structural checking is enabled.- Throws:
XMLStreamException
-
_reportNwfStructure
- Throws:
XMLStreamException
-
_reportNwfContent
This is the method called when an output method call violates content well-formedness checks and content validation is enabled.- Throws:
XMLStreamException
-
_reportNwfContent
- Throws:
XMLStreamException
-
_reportNwfAttr
This is the method called when an output method call violates attribute well-formedness checks (trying to output dup attrs) and name validaty checking is enabled.- Throws:
XMLStreamException
-
_reportNwfAttr
- Throws:
XMLStreamException
-
_reportNwfName
- Throws:
XMLStreamException
-
throwFromIOE
- Throws:
XMLStreamException
-
reportIllegalArg
- Throws:
IllegalArgumentException
-
_reportInvalidContent
- Throws:
XMLStreamException
-
_reportValidationProblem
- Throws:
XMLStreamException
-
_finishDocument
- Throws:
XMLStreamException
-
toString
-