public class ToXMLStream extends ToStream
Modifier and Type | Field and Description |
---|---|
static String |
CDATA_CONTINUE
To insert ]]> in a CDATA section by ending the last CDATA section with
]] and starting the next CDATA section with >
|
static String |
CDATA_DELIMITER_CLOSE
The constant "]]>"
|
static String |
CDATA_DELIMITER_OPEN |
static String |
DEFAULT_SAX_SERIALIZER |
static String |
EMPTYSTRING |
static String |
ENTITY_AMP |
static String |
ENTITY_CRLF |
static String |
ENTITY_GT |
static String |
ENTITY_LT |
static String |
ENTITY_QUOT |
static String |
XML_PREFIX |
static String |
XMLNS_PREFIX |
static String |
XMLNS_URI |
static String |
XMLVERSION10 |
static String |
XMLVERSION11
Define the XML version.
|
m_cdataStartCalled, m_charInfo, m_disableOutputEscapingStates, m_escaping, m_inDoctype, m_ispreserve, m_isprevtext, m_lineSep, m_lineSepLen, m_lineSepUse, m_preserves, m_spaceBeforeClose
m_attrBuff, m_attributes, m_CdataElems, m_cdataTagOpen, m_charsBuff, m_doctypePublic, m_doctypeSystem, m_doIndent, m_elemContext, m_indentAmount, m_inEntityRef, m_inExternalDTD, m_mediatype, m_needToCallStartDocument, m_prefixMap, m_shouldNotWriteXMLHeader, m_sourceLocator, m_standaloneWasSpecified, m_StringOfCDATASections, m_tracer, m_version, m_writer, PKG_NAME, PKG_PATH
HTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS
Constructor and Description |
---|
ToXMLStream()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String uri,
String localName,
String rawName,
String type,
String value,
boolean xslAttribute)
Add an attribute to the current element.
|
void |
addUniqueAttribute(String name,
String value,
int flags)
This method is used to add an attribute to the currently open element.
|
void |
CopyFrom(ToXMLStream xmlListener)
Copy properties from another SerializerToXML.
|
void |
endDocument()
Receive notification of the end of a document.
|
void |
endElement(String elemName)
Receive notification of the end of an element.
|
void |
endPreserving()
Ends a whitespace preserving section.
|
void |
entityReference(String name)
Receive notivication of a entityReference.
|
void |
namespaceAfterStartElement(String prefix,
String uri)
This method is used to notify the serializer of a namespace mapping (or node)
that applies to the current element whose startElement() call has already been seen.
|
void |
processingInstruction(String target,
String data)
Receive notification of a processing instruction.
|
protected boolean |
pushNamespace(String prefix,
String uri)
From XSLTC
Declare a prefix to point to a namespace URI.
|
boolean |
reset()
Try's to reset the super class and reset this class for
re-use, so that you don't need to create a new serializer
(mostly for performance reasons).
|
void |
startDocumentInternal()
Receive notification of the beginning of a document.
|
void |
startPreserving()
Starts a whitespace preserving section.
|
addAttributeAlways, addCdataSectionElements, attributeDecl, cdata, characters, characters, charactersRaw, closeCDATA, closeStartTag, comment, elementDecl, endCDATA, endDTD, endElement, endNonEscaping, endPrefixMapping, ensureAttributesNamespaceIsDeclared, escapingNotNeeded, externalEntityDecl, firePseudoAttributes, flushPending, flushWriter, getIndentAmount, getOutputFormat, getOutputStream, getWriter, ignorableWhitespace, indent, indent, internalEntityDecl, notationDecl, outputLineSep, processAttributes, serialize, setCdataSectionElements, setContentHandler, setDTDEntityExpansion, setEncoding, setEscaping, setIndentAmount, setLineSepUse, setNewLine, setOutputFormat, setOutputStream, setTransformer, setWriter, shouldIndent, skippedEntity, startCDATA, startDTD, startElement, startElement, startElement, startEntity, startNonEscaping, startPrefixMapping, startPrefixMapping, unparsedEntityDecl, writeAttrString, writeUTF16Surrogate
addAttribute, addAttribute, addAttributes, addXSLAttribute, asContentHandler, asDOM3Serializer, asDOMSerializer, characters, close, comment, documentIsEmpty, endEntity, error, fatalError, fireCDATAEvent, fireCharEvent, fireCommentEvent, fireEndDoc, fireEndElem, fireEndEntity, fireEntityReference, fireEscapingEvent, fireStartDoc, fireStartElem, fireStartEntity, getDoctypePublic, getDoctypeSystem, getEncoding, getIndent, getLocalName, getMediaType, getNamespaceMappings, getNamespaceURI, getNamespaceURIFromPrefix, getOmitXMLDeclaration, getOutputProperty, getOutputPropertyDefault, getOutputPropertyNonDefault, getPrefix, getPrefixPart, getStandalone, getTransformer, getVersion, initCDATA, isCdataSection, patchName, setDoctype, setDoctypePublic, setDoctypeSystem, setDocumentLocator, setIndent, setMediaType, setNamespaceMappings, setOmitXMLDeclaration, setOutputProperty, setOutputPropertyDefault, setSourceLocator, setStandalone, setStandaloneInternal, setVersion, startDocument, warning
public static final String CDATA_CONTINUE
public static final String CDATA_DELIMITER_CLOSE
public static final String CDATA_DELIMITER_OPEN
public static final String EMPTYSTRING
public static final String ENTITY_AMP
public static final String ENTITY_CRLF
public static final String ENTITY_GT
public static final String ENTITY_LT
public static final String ENTITY_QUOT
public static final String XML_PREFIX
public static final String XMLNS_PREFIX
public static final String XMLNS_URI
public static final String DEFAULT_SAX_SERIALIZER
public static final String XMLVERSION11
public static final String XMLVERSION10
public void CopyFrom(ToXMLStream xmlListener)
xmlListener
- non-null reference to a SerializerToXML object.public void startDocumentInternal() throws SAXException
startDocumentInternal
in class SerializerBase
SAXException
- Any SAX exception, possibly
wrapping another exception.SAXException
public void endDocument() throws SAXException
SAXException
- Any SAX exception, possibly
wrapping another exception.SAXException
public void startPreserving() throws SAXException
The contents of the whitespace preserving section will be delivered through the regular characters event.
SAXException
public void endPreserving() throws SAXException
SAXException
startPreserving()
public void processingInstruction(String target, String data) throws SAXException
target
- The processing instruction target.data
- The processing instruction data, or null if
none was supplied.SAXException
- Any SAX exception, possibly
wrapping another exception.SAXException
public void entityReference(String name) throws SAXException
entityReference
in interface ExtendedContentHandler
entityReference
in class SerializerBase
name
- The name of the entity.SAXException
public void addUniqueAttribute(String name, String value, int flags) throws SAXException
name
- the qualified name of the attributevalue
- the value of the attribute which can contain only
ASCII printable characters characters in the range 32 to 127 inclusive.flags
- the bit values of this integer give optimization information.SAXException
public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean xslAttribute) throws SAXException
addAttribute
in interface ExtendedContentHandler
addAttribute
in class SerializerBase
uri
- the URI associated with the element namelocalName
- local part of the attribute namerawName
- prefix:localNametype
- value
- the value of the attributexslAttribute
- true if this attribute is from an xsl:attribute,
false if declared within the elements opening tag.SAXException
ExtendedContentHandler.addAttribute(String, String, String, String, String)
public void endElement(String elemName) throws SAXException
ToStream
endElement
in interface ExtendedContentHandler
endElement
in class ToStream
elemName
- The element type nameSAXException
ExtendedContentHandler.endElement(String)
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException
namespaceAfterStartElement
in interface ExtendedContentHandler
namespaceAfterStartElement
in class SerializerBase
prefix
- the URI of the namespaceuri
- the prefix associated with the given URI.SAXException
ExtendedContentHandler.namespaceAfterStartElement(String, String)
protected boolean pushNamespace(String prefix, String uri)
public boolean reset()
reset
in interface Serializer
reset
in class ToStream
Copyright © 2019 JBoss by Red Hat. All rights reserved.