public class SimpleNsStreamWriter extends BaseNsStreamWriter
XMLStreamWriter
, that does
not do namespace repairing, ie doesn't try to resolve possible
conflicts between prefixes and namespace URIs, or automatically
create namespace bindings.ERR_NSDECL_WRONG_STATE, mAutomaticNS, mCurrElem, mEmptyElementHandler, mOutputElemPool, mPoolSize, mRootNsContext, sPrefixXml, sPrefixXmlns
mValueEncoderFactory
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_TREE
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_STRUCTURE
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Constructor and Description |
---|
SimpleNsStreamWriter(XmlWriter xw,
String enc,
WriterConfig cfg) |
Modifier and Type | Method and Description |
---|---|
void |
copyStartElement(InputElementStack elemStack,
AttributeCollector attrCollector)
Element copier method implementation suitable to be used with
namespace-aware writers in non-repairing (explicit namespaces) mode.
|
void |
doSetPrefix(String prefix,
String uri) |
void |
setDefaultNamespace(String uri) |
String |
validateQNamePrefix(QName name)
Method called before writing a QName via Typed Access API.
|
void |
writeAttribute(String nsURI,
String localName,
String value) |
void |
writeAttribute(String prefix,
String nsURI,
String localName,
String value) |
void |
writeDefaultNamespace(String nsURI) |
void |
writeNamespace(String prefix,
String nsURI) |
void |
writeStartElement(StartElement elem)
Convenience method needed by
XMLEventWriter
implementation, to use when
writing a start element, and possibly its attributes and namespace
declarations. |
protected void |
writeStartOrEmpty(String localName,
String nsURI) |
protected void |
writeStartOrEmpty(String prefix,
String localName,
String nsURI) |
checkStartElement, closeStartElement, doWriteAttr, doWriteAttr, doWriteDefaultNs, doWriteEndTag, doWriteNamespace, doWriteStartTag, doWriteStartTag, getCurrentElementName, getNamespaceContext, getNamespaceURI, getPrefix, getTopElementDesc, setNamespaceContext, setPrefix, writeAttribute, writeEmptyElement, writeEmptyElement, writeEmptyElement, writeEndElement, writeEndElement, writeFullEndElement, writeStartElement, writeStartElement, writeStartElement, writeTypedAttribute
valueEncoderFactory, writeBinary, 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, writeQNameAttribute, writeTypedElement
addDefaultAttribute, close, closeCompletely, copyEventFromReader, doReportProblem, doReportProblem, doWriteStartDocument, findAttributeIndex, flush, getAttributeCount, getAttributeLocalName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getBaseUri, getCopyBuffer, getCopyBuffer, getEncoding, getLocation, getProperty, getValidationLocation, getXmlVersion, inPrologOrEpilog, isNotationDeclared, isPropertySupported, isUnparsedEntityDeclared, isValidating, reportIllegalArg, reportIllegalMethod, reportInvalidContent, reportNwfAttr, reportNwfAttr, reportNwfContent, reportNwfContent, reportNwfStructure, reportNwfStructure, reportProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, setProperty, setValidationProblemHandler, stopValidatingAgainst, stopValidatingAgainst, throwFromIOE, throwOutputError, throwOutputError, toString, validateAgainst, verifyRootElement, verifyWriteCData, verifyWriteDTD, wrapAsRawWriter, wrapAsTextWriter, writeCData, writeCData, writeCharacters, writeCharacters, writeCharacters, writeComment, writeDTD, writeDTD, writeDTD, writeEndDocument, writeEntityRef, writeProcessingInstruction, writeProcessingInstruction, writeRaw, writeRaw, writeRaw, writeSpace, writeSpace, writeStartDocument, writeStartDocument, writeStartDocument, writeStartDocument
public SimpleNsStreamWriter(XmlWriter xw, String enc, WriterConfig cfg)
public void writeAttribute(String nsURI, String localName, String value) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
writeAttribute
in class BaseNsStreamWriter
XMLStreamException
public void writeAttribute(String prefix, String nsURI, String localName, String value) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
writeAttribute
in class BaseNsStreamWriter
XMLStreamException
public void writeDefaultNamespace(String nsURI) throws XMLStreamException
writeDefaultNamespace
in interface XMLStreamWriter
writeDefaultNamespace
in class BaseNsStreamWriter
XMLStreamException
public void writeNamespace(String prefix, String nsURI) throws XMLStreamException
writeNamespace
in interface XMLStreamWriter
writeNamespace
in class BaseNsStreamWriter
XMLStreamException
public void setDefaultNamespace(String uri) throws XMLStreamException
setDefaultNamespace
in interface XMLStreamWriter
setDefaultNamespace
in class BaseNsStreamWriter
XMLStreamException
public void doSetPrefix(String prefix, String uri) throws XMLStreamException
doSetPrefix
in class BaseNsStreamWriter
XMLStreamException
public void writeStartElement(StartElement elem) throws XMLStreamException
BaseStreamWriter
XMLEventWriter
implementation, to use when
writing a start element, and possibly its attributes and namespace
declarations.writeStartElement
in class BaseNsStreamWriter
XMLStreamException
protected void writeStartOrEmpty(String localName, String nsURI) throws XMLStreamException
writeStartOrEmpty
in class BaseNsStreamWriter
XMLStreamException
protected void writeStartOrEmpty(String prefix, String localName, String nsURI) throws XMLStreamException
writeStartOrEmpty
in class BaseNsStreamWriter
XMLStreamException
public final void copyStartElement(InputElementStack elemStack, AttributeCollector attrCollector) throws IOException, XMLStreamException
setPrefix
, writeNamespace
and writeStartElement
; the order writers expect is
bit different from the order in which element information is
passed in.copyStartElement
in class BaseStreamWriter
IOException
XMLStreamException
public String validateQNamePrefix(QName name)
BaseStreamWriter
validateQNamePrefix
in class BaseStreamWriter
Copyright © 2018 FasterXML. All rights reserved.