Class TypedStreamWriter
java.lang.Object
org.codehaus.stax2.ri.Stax2WriterImpl
com.ctc.wstx.sw.BaseStreamWriter
com.ctc.wstx.sw.TypedStreamWriter
- All Implemented Interfaces:
OutputConfigFlags, XMLStreamConstants, XMLStreamWriter, org.codehaus.stax2.typed.TypedXMLStreamWriter, org.codehaus.stax2.validation.Validatable, org.codehaus.stax2.validation.ValidationContext, org.codehaus.stax2.XMLStreamWriter2
- Direct Known Subclasses:
BaseNsStreamWriter, NonNsStreamWriter
Intermediate base class that implements Typed Access API (Stax2 v3)
for all (repairing, non-repairing, non-namespace) native stream
writer implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.codehaus.stax2.ri.typed.ValueEncoderFactoryWhen outputting using Typed Access API, we will need encoders.Fields inherited from class BaseStreamWriter
ATTR_MIN_ARRAYCOPY, CHAR_SPACE, DEFAULT_COPYBUFFER_LEN, mAnyOutput, mCfgAutomaticEmptyElems, mCfgCDataAsText, mCfgCopyDefaultAttrs, mCheckAttrs, mCheckStructure, mConfig, mCopyBuffer, mDtdRootElem, mEmptyElement, mEncoding, MIN_ARRAYCOPY, mReturnNullForDefaultNamespace, mStartElementOpen, mState, mValidator, mVldContent, mVldProbHandler, mWriter, mXml11, STATE_EPILOG, STATE_PROLOG, STATE_TREEFields inherited from interface OutputConfigFlags
CFG_ADD_SPACE_AFTER_EMPTY_ELEM, CFG_AUTO_CLOSE_OUTPUT, CFG_AUTOMATIC_EMPTY_ELEMENTS, CFG_AUTOMATIC_END_ELEMENTS, CFG_AUTOMATIC_NS, CFG_COPY_DEFAULT_ATTRS, CFG_ENABLE_NS, CFG_ESCAPE_CR, CFG_FIX_CONTENT, CFG_OUTPUT_CDATA_AS_TEXT, CFG_USE_DOUBLE_QUOTES_IN_XML_DECL, CFG_VALIDATE_ATTR, CFG_VALIDATE_CONTENT, CFG_VALIDATE_NAMES, CFG_VALIDATE_STRUCTUREFields 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
ConstructorsModifierConstructorDescriptionprotectedTypedStreamWriter(XmlWriter xw, String enc, WriterConfig cfg) -
Method Summary
Modifier and TypeMethodDescriptionprivate StringserializeQName(QName name) protected final org.codehaus.stax2.ri.typed.ValueEncoderFactoryvoidwriteBinary(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 value) voidwriteBooleanAttribute(String prefix, String nsURI, String localName, boolean value) voidwriteDecimal(BigDecimal value) voidwriteDecimalAttribute(String prefix, String nsURI, String localName, BigDecimal value) voidwriteDouble(double value) voidwriteDoubleArray(double[] value, int from, int length) voidwriteDoubleArrayAttribute(String prefix, String nsURI, String localName, double[] value) voidwriteDoubleAttribute(String prefix, String nsURI, String localName, double value) voidwriteFloat(float value) voidwriteFloatArray(float[] value, int from, int length) voidwriteFloatArrayAttribute(String prefix, String nsURI, String localName, float[] value) voidwriteFloatAttribute(String prefix, String nsURI, String localName, float value) voidwriteInt(int value) final voidwriteIntArray(int[] value, int from, int length) voidwriteIntArrayAttribute(String prefix, String nsURI, String localName, int[] value) voidwriteIntAttribute(String prefix, String nsURI, String localName, int value) voidwriteInteger(BigInteger value) 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) voidwriteLongAttribute(String prefix, String nsURI, String localName, long value) voidwriteQName(QName name) voidwriteQNameAttribute(String prefix, String nsURI, String localName, QName name) protected abstract voidwriteTypedAttribute(String prefix, String nsURI, String localName, org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) Method that will write attribute with value that is known not to require additional escaping.protected final voidwriteTypedElement(org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) Methods inherited from class BaseStreamWriter
addDefaultAttribute, close, closeCompletely, closeStartElement, copyEventFromReader, copyStartElement, doReportProblem, doReportProblem, doWriteStartDocument, findAttributeIndex, flush, getAttributeCount, getAttributeLocalName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getBaseUri, getCopyBuffer, getCopyBuffer, getCurrentElementName, getEncoding, getLocation, getNamespaceContext, getNamespaceURI, getPrefix, getProperty, getTopElementDesc, getValidationLocation, getXmlVersion, inPrologOrEpilog, isNotationDeclared, isPropertySupported, isUnparsedEntityDeclared, isValidating, reportIllegalArg, reportIllegalMethod, reportInvalidContent, reportNwfAttr, reportNwfAttr, reportNwfContent, reportNwfContent, reportNwfStructure, reportNwfStructure, reportProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, setDefaultNamespace, setNamespaceContext, setPrefix, setProperty, setValidationProblemHandler, stopValidatingAgainst, stopValidatingAgainst, throwFromIOE, throwOutputError, throwOutputError, toString, validateAgainst, validateQNamePrefix, verifyRootElement, verifyWriteCData, verifyWriteDTD, wrapAsRawWriter, wrapAsTextWriter, writeAttribute, writeAttribute, writeAttribute, writeCData, writeCData, writeCharacters, writeCharacters, writeCharacters, writeComment, writeDefaultNamespace, writeDTD, writeDTD, writeDTD, writeEmptyElement, writeEmptyElement, writeEmptyElement, writeEndDocument, writeEndElement, writeEndElement, writeEntityRef, writeFullEndElement, writeNamespace, writeProcessingInstruction, writeProcessingInstruction, writeRaw, writeRaw, writeRaw, writeSpace, writeSpace, writeStartDocument, writeStartDocument, writeStartDocument, writeStartDocument, writeStartElement, writeStartElement, writeStartElement, writeStartElementMethods inherited from class org.codehaus.stax2.ri.Stax2WriterImpl
copyStartElement
-
Field Details
-
mValueEncoderFactory
protected org.codehaus.stax2.ri.typed.ValueEncoderFactory mValueEncoderFactoryWhen outputting using Typed Access API, we will need encoders. If so, they will created by lazily-constructed factory
-
-
Constructor Details
-
TypedStreamWriter
-
-
Method Details
-
valueEncoderFactory
protected final org.codehaus.stax2.ri.typed.ValueEncoderFactory valueEncoderFactory() -
writeBoolean
- Throws:
XMLStreamException
-
writeInt
- Throws:
XMLStreamException
-
writeLong
- Throws:
XMLStreamException
-
writeFloat
- Throws:
XMLStreamException
-
writeDouble
- Throws:
XMLStreamException
-
writeInteger
- Throws:
XMLStreamException
-
writeDecimal
- Throws:
XMLStreamException
-
writeQName
- Throws:
XMLStreamException
-
writeIntArray
- Throws:
XMLStreamException
-
writeLongArray
- Throws:
XMLStreamException
-
writeFloatArray
- Throws:
XMLStreamException
-
writeDoubleArray
- Throws:
XMLStreamException
-
writeBinary
- Throws:
XMLStreamException
-
writeBinary
public void writeBinary(org.codehaus.stax2.typed.Base64Variant v, byte[] value, int from, int length) throws XMLStreamException - Throws:
XMLStreamException
-
writeTypedElement
protected final void writeTypedElement(org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) throws XMLStreamException - Throws:
XMLStreamException
-
writeBooleanAttribute
public void writeBooleanAttribute(String prefix, String nsURI, String localName, boolean value) throws XMLStreamException - Throws:
XMLStreamException
-
writeIntAttribute
public void writeIntAttribute(String prefix, String nsURI, String localName, int value) throws XMLStreamException - Throws:
XMLStreamException
-
writeLongAttribute
public void writeLongAttribute(String prefix, String nsURI, String localName, long value) throws XMLStreamException - Throws:
XMLStreamException
-
writeFloatAttribute
public void writeFloatAttribute(String prefix, String nsURI, String localName, float value) throws XMLStreamException - Throws:
XMLStreamException
-
writeDoubleAttribute
public void writeDoubleAttribute(String prefix, String nsURI, String localName, double value) throws XMLStreamException - Throws:
XMLStreamException
-
writeIntegerAttribute
public void writeIntegerAttribute(String prefix, String nsURI, String localName, BigInteger value) throws XMLStreamException - Throws:
XMLStreamException
-
writeDecimalAttribute
public void writeDecimalAttribute(String prefix, String nsURI, String localName, BigDecimal value) throws XMLStreamException - Throws:
XMLStreamException
-
writeQNameAttribute
public void writeQNameAttribute(String prefix, String nsURI, String localName, QName name) throws XMLStreamException - Throws:
XMLStreamException
-
writeIntArrayAttribute
public void writeIntArrayAttribute(String prefix, String nsURI, String localName, int[] value) throws XMLStreamException - Throws:
XMLStreamException
-
writeLongArrayAttribute
public void writeLongArrayAttribute(String prefix, String nsURI, String localName, long[] value) throws XMLStreamException - Throws:
XMLStreamException
-
writeFloatArrayAttribute
public void writeFloatArrayAttribute(String prefix, String nsURI, String localName, float[] value) throws XMLStreamException - Throws:
XMLStreamException
-
writeDoubleArrayAttribute
public void writeDoubleArrayAttribute(String prefix, String nsURI, String localName, double[] value) throws XMLStreamException - Throws:
XMLStreamException
-
writeBinaryAttribute
public void writeBinaryAttribute(String prefix, String nsURI, String localName, byte[] value) throws XMLStreamException - Throws:
XMLStreamException
-
writeBinaryAttribute
public void writeBinaryAttribute(org.codehaus.stax2.typed.Base64Variant v, String prefix, String nsURI, String localName, byte[] value) throws XMLStreamException - Throws:
XMLStreamException
-
writeTypedAttribute
protected abstract void writeTypedAttribute(String prefix, String nsURI, String localName, org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) throws XMLStreamException Method that will write attribute with value that is known not to require additional escaping.- Throws:
XMLStreamException
-
serializeQName
- Throws:
XMLStreamException
-