public abstract class ToSAXHandler extends SerializerBase
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 |
protected LexicalHandler |
m_lexHandler
Underlying LexicalHandler.
|
protected ContentHandler |
m_saxHandler
Underlying SAX handler.
|
protected TransformStateSetter |
m_state
If this is true, then the content handler wrapped by this
serializer implements the TransformState interface which
will give the content handler access to the state of
the transform.
|
static String |
XML_PREFIX |
static String |
XMLNS_PREFIX |
static String |
XMLNS_URI |
static String |
XMLVERSION10 |
static String |
XMLVERSION11
Define the XML version.
|
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 |
---|
ToSAXHandler() |
ToSAXHandler(ContentHandler hdlr,
LexicalHandler lex,
String encoding) |
ToSAXHandler(ContentHandler handler,
String encoding) |
Modifier and Type | Method and Description |
---|---|
void |
addUniqueAttribute(String qName,
String value,
int flags)
Add a unique attribute
|
void |
characters(Node node)
This method gets the node's value as a String and uses that String as if
it were an input character notification.
|
void |
characters(String characters)
Receive notification of character data.
|
protected void |
closeCDATA() |
protected void |
closeStartTag() |
void |
comment(String comment)
Receive notification of a comment.
|
void |
error(SAXParseException exc) |
void |
fatalError(SAXParseException exc) |
void |
flushPending()
This method flushes any pending events, which can be startDocument()
closing the opening tag of an element, or closing an open CDATA section.
|
void |
processingInstruction(String target,
String data)
Do nothing as this is an abstract class.
|
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 |
setCdataSectionElements(Vector URI_and_localNames)
Does nothing.
|
void |
setContentHandler(ContentHandler _saxHandler)
Sets the SAX ContentHandler.
|
void |
setLexHandler(LexicalHandler _lexHandler)
Sets the LexicalHandler.
|
void |
setShouldOutputNSAttr(boolean doOutputNSAttr)
Set whether or not namespace declarations (e.g.
|
void |
setTransformState(TransformStateSetter ts)
Pass in a reference to a TransformState object, which
can be used during SAX ContentHandler events to obtain
information about he state of the transformation.
|
protected void |
startDocumentInternal()
Pass callback to the SAX Handler
|
void |
startDTD(String arg0,
String arg1,
String arg2)
Do nothing.
|
void |
startElement(String qName)
An element starts, but attributes are not fully known yet.
|
void |
startElement(String uri,
String localName,
String qName)
Receives notification that an element starts, but attributes are not
fully known yet.
|
void |
startElement(String arg0,
String arg1,
String arg2,
Attributes arg3)
Receive notification of the beginning of an element, although this is a
SAX method additional namespace or attribute information can occur before
or after this call, that is associated with this element.
|
void |
warning(SAXParseException exc) |
addAttribute, addAttribute, addAttribute, addAttributeAlways, addAttributes, addXSLAttribute, asContentHandler, asDOM3Serializer, asDOMSerializer, close, documentIsEmpty, endEntity, entityReference, fireCDATAEvent, fireCharEvent, fireCommentEvent, fireEndDoc, fireEndElem, fireEndEntity, fireEntityReference, fireEscapingEvent, fireStartDoc, fireStartElem, fireStartEntity, getDoctypePublic, getDoctypeSystem, getEncoding, getIndent, getIndentAmount, getLocalName, getMediaType, getNamespaceMappings, getNamespaceURI, getNamespaceURIFromPrefix, getOmitXMLDeclaration, getOutputProperty, getOutputPropertyDefault, getOutputPropertyNonDefault, getPrefix, getPrefixPart, getStandalone, getTransformer, getVersion, initCDATA, isCdataSection, namespaceAfterStartElement, notationDecl, patchName, setDoctype, setDoctypePublic, setDoctypeSystem, setDocumentLocator, setDTDEntityExpansion, setEncoding, setIndent, setIndentAmount, setMediaType, setNamespaceMappings, setOmitXMLDeclaration, setOutputProperty, setOutputPropertyDefault, setSourceLocator, setStandalone, setStandaloneInternal, setTransformer, setVersion, startDocument, unparsedEntityDecl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
serialize, setEscaping
endElement, startPrefixMapping
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, skippedEntity, startPrefixMapping
comment, endCDATA, endDTD, startCDATA, startEntity
attributeDecl, elementDecl, externalEntityDecl, internalEntityDecl
getOutputFormat, getOutputStream, getWriter, setOutputFormat, setOutputStream, setWriter
protected ContentHandler m_saxHandler
protected LexicalHandler m_lexHandler
protected TransformStateSetter m_state
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 ToSAXHandler()
public ToSAXHandler(ContentHandler hdlr, LexicalHandler lex, String encoding)
public ToSAXHandler(ContentHandler handler, String encoding)
protected void startDocumentInternal() throws SAXException
startDocumentInternal
in class SerializerBase
SAXException
public void startDTD(String arg0, String arg1, String arg2) throws SAXException
SAXException
LexicalHandler.startDTD(String, String, String)
public void characters(String characters) throws SAXException
characters
- The string of characters to process.SAXException
ExtendedContentHandler.characters(String)
public void comment(String comment) throws SAXException
comment
in interface ExtendedLexicalHandler
comment
in class SerializerBase
comment
- the comment, but unlike the SAX comment() method this
method takes a String rather than a character array.SAXException
ExtendedLexicalHandler.comment(String)
public void processingInstruction(String target, String data) throws SAXException
SAXException
ContentHandler.processingInstruction(String, String)
protected void closeStartTag() throws SAXException
SAXException
protected void closeCDATA() throws SAXException
SAXException
public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException
SAXException
- Any SAX exception, possibly
wrapping another exception.SAXException
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
,
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
,
AttributeList
,
ContentHandler.startElement(String,String,String,Attributes)
public void setLexHandler(LexicalHandler _lexHandler)
_lexHandler
- The LexicalHandler to setpublic void setContentHandler(ContentHandler _saxHandler)
_saxHandler
- The ContentHandler to setSerializer.asContentHandler()
,
ToSAXHandler
public void setCdataSectionElements(Vector URI_and_localNames)
URI_and_localNames
- pairs of namespace URI and local names that
identify elements whose text elements are to be output as CDATA sections.
The namespace of the local element must be the given URI to match. The
qName is not given because the prefix does not matter, only the namespace
URI to which that prefix would map matters, so the prefix itself is not
relevant in specifying which elements have their text to be output as
CDATA sections.XSLOutputAttributes.setCdataSectionElements(java.util.Vector)
public void setShouldOutputNSAttr(boolean doOutputNSAttr)
doOutputNSAttr
- whether or not namespace declarations
should appear as attributespublic void flushPending() throws SAXException
SAXException
public void setTransformState(TransformStateSetter ts)
ts
- A reference to a TransformState objectpublic void startElement(String uri, String localName, String qName) throws SAXException
uri
- the URI of the namespace of the element (optional)localName
- the element name, but without prefix (optional)qName
- the element name, with prefix, if any (required)SAXException
ExtendedContentHandler.startElement(String, String, String)
public void startElement(String qName) throws SAXException
qName
- the element name, with prefix (if any).SAXException
ExtendedContentHandler.startElement(String)
public void characters(Node node) throws SAXException
characters
in interface ExtendedContentHandler
characters
in class SerializerBase
node
- the Node to serializeSAXException
public void fatalError(SAXParseException exc) throws SAXException
fatalError
in interface ErrorHandler
fatalError
in class SerializerBase
SAXException
ErrorHandler.fatalError(SAXParseException)
public void error(SAXParseException exc) throws SAXException
error
in interface ErrorHandler
error
in class SerializerBase
SAXException
ErrorHandler.error(SAXParseException)
public void warning(SAXParseException exc) throws SAXException
warning
in interface ErrorHandler
warning
in class SerializerBase
SAXException
ErrorHandler.warning(SAXParseException)
public boolean reset()
reset
in interface Serializer
reset
in class SerializerBase
Serializer.reset()
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException
qName
- the fully qualified attribute name.value
- the attribute valueflags
- a bitwise flagSAXException
Copyright © 2018 JBoss by Red Hat. All rights reserved.