Modifier and Type | Field and Description |
---|---|
protected LexicalHandler | m_lexHandler
Underlying LexicalHandler. |
protected ContentHandler | m_saxHandler
Underlying SAX handler. |
private boolean | m_shouldGenerateNSAttribute
A startPrefixMapping() call on a ToSAXHandler will pass that call on to the wrapped ContentHandler, but should we also mirror these calls with matching attributes, if so this field is true. |
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. |
Access | Constructor and Description |
---|---|
public | |
public | |
public |
Modifier and Type | Method and Description |
---|---|
public void | addUniqueAttribute(String
the fully qualified attribute name. qName, String the attribute value value, int a bitwise flag flags)Implements com. Add a unique attribute |
public void | characters(String
The string of characters to process. chars)Implements com. Receive notification of character data. |
public void | characters(Node
the Node to serialize node)Overrides com. Implements com. This method gets the node's value as a String and uses that String as if it were an input character notification. |
protected void | |
protected void | |
public void | comment(String
the comment, but unlike the SAX comment() method this
method takes a String rather than a character array. comment)Overrides com. Implements com. Receive notification of a comment. |
public void | error(SAXParseException
The error information encapsulated in a
SAX parse exception. exc)Overrides com. Implements org. Receive notification of a recoverable error. |
public void | fatalError(SAXParseException
The error information encapsulated in a
exc)SAXParseException .Overrides com. Implements org. Receive notification of a non-recoverable, fatal error. |
public void | flushPending()
Implements com. This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section. |
pack-priv boolean | getShouldOutputNSAttr()
Returns true if namespace declarations from calls such as startPrefixMapping("prefix1","uri1") should also be mirrored with self generated additional attributes of elements that declare the namespace, for example the attribute xmlns:prefix1="uri1" |
public void | processingInstruction(String
the processing instruction target target, String the processing instruction data, or null if
none was supplied. The data does not include any
whitespace separating it from the target data)Implements org. Do nothing as this is an abstract class. |
public boolean | Returns: true if the class was successfuly reset.Overrides com. Implements com. 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). |
private void | |
public void | setCdataSectionElements(List<String>
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. URI_and_localNames)Implements com. Does nothing. |
public void | setContentHandler(ContentHandler
The ContentHandler to set _saxHandler)Implements com. Sets the SAX ContentHandler. |
public void | |
public void | setShouldOutputNSAttr(boolean
whether or not namespace declarations
should appear as attributes doOutputNSAttr)Set whether or not namespace declarations (e.g. xmlns:foo) should appear as attributes of elements |
public void | setTransformState(TransformStateSetter
A reference to a TransformState object 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()
Overrides com. Pass callback to the SAX Handler |
public void | startDTD(String
The document type name. arg0, String The declared public identifier for the
external DTD subset, or null if none was declared. arg1, String The declared system identifier for the
external DTD subset, or null if none was declared.
(Note that this is not resolved against the document
base URI.) arg2)Implements org. Do nothing. |
public void | startElement(String
the Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed arg0, String the local name (without prefix), or the
empty string if Namespace processing is not being
performed arg1, String the qualified name (with prefix), or the
empty string if qualified names are not available arg2, Attributes the attributes attached to the element. If
there are no attributes, it shall be an empty
Attributes object. The value of this object after
startElement returns is undefined arg3)Implements org. 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. |
public void | startElement(String
the URI of the namespace of the element (optional) uri, String the element name, but without prefix (optional) localName, String the element name, with prefix, if any (required) qName)Implements com. Receives notification that an element starts, but attributes are not fully known yet. |
public void | startElement(String
the element name, with prefix (if any). qName)Implements com. An element starts, but attributes are not fully known yet. |
public void | warning(SAXParseException
The warning information encapsulated in a
SAX parse exception. exc)Overrides com. Implements org. Receive notification of a warning. |
m_lexHandler | back to summary |
---|---|
protected LexicalHandler m_lexHandler Underlying LexicalHandler. Taken from XSLTC |
m_saxHandler | back to summary |
---|---|
protected ContentHandler m_saxHandler Underlying SAX handler. Taken from XSLTC |
m_shouldGenerateNSAttribute | back to summary |
---|---|
private boolean m_shouldGenerateNSAttribute A startPrefixMapping() call on a ToSAXHandler will pass that call on to the wrapped ContentHandler, but should we also mirror these calls with matching attributes, if so this field is true. For example if this field is true then a call such as startPrefixMapping("prefix1","uri1") will also cause the additional internally generated attribute xmlns:prefix1="uri1" to be effectively added to the attributes passed to the wrapped ContentHandler. |
m_state | back to summary |
---|---|
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. |
ToSAXHandler | back to summary |
---|---|
public ToSAXHandler() |
ToSAXHandler | back to summary |
---|---|
public ToSAXHandler(ContentHandler hdlr, LexicalHandler lex, String encoding) |
ToSAXHandler | back to summary |
---|---|
public ToSAXHandler(ContentHandler handler, String encoding) |
addUniqueAttribute | back to summary |
---|---|
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException Implements com. Add a unique attribute
|
characters | back to summary |
---|---|
public void characters(String chars) throws SAXException Implements com. Receive notification of character data.
|
characters | back to summary |
---|---|
public void characters(Node node) throws SAXException Overrides com. Implements com. This method gets the node's value as a String and uses that String as if it were an input character notification.
|
closeCDATA | back to summary |
---|---|
protected void closeCDATA() throws SAXException |
closeStartTag | back to summary |
---|---|
protected void closeStartTag() throws SAXException |
comment | back to summary |
---|---|
public void comment(String comment) throws SAXException Overrides com. Implements com. Receive notification of a comment.
|
error | back to summary |
---|---|
public void error(SAXParseException exc) throws SAXException Overrides com. Implements org. Doc from org. Receive notification of a recoverable error. This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action. The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML recommendation does not require it to do so. Filters may use this method to report other, non-XML errors as well.
|
fatalError | back to summary |
---|---|
public void fatalError(SAXParseException exc) throws SAXException Overrides com. Implements org. Doc from org. Receive notification of a non-recoverable, fatal error. As defined in section 1.2 of the W3C XML 1.0 Recommendation, fatal errors are those that would make it impossible for a parser to continue normal processing. These include violation of a well-formedness constraint, invalid encoding, and forbidden structural errors as described in the W3C XML 1.0 Recommendation.
|
flushPending | back to summary |
---|---|
public void flushPending() throws SAXException Implements com. This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section. |
getShouldOutputNSAttr | back to summary |
---|---|
pack-priv boolean getShouldOutputNSAttr() Returns true if namespace declarations from calls such as startPrefixMapping("prefix1","uri1") should also be mirrored with self generated additional attributes of elements that declare the namespace, for example the attribute xmlns:prefix1="uri1" |
processingInstruction | back to summary |
---|---|
public void processingInstruction(String target, String data) throws SAXException Implements org. Do nothing as this is an abstract class. All subclasses will need to define their behavior if it is different.
|
reset | back to summary |
---|---|
public boolean reset() Overrides com. Implements com. 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).
|
resetToSAXHandler | back to summary |
---|---|
private void resetToSAXHandler() Reset all of the fields owned by ToSAXHandler class |
setCdataSectionElements | back to summary |
---|---|
public void setCdataSectionElements(List<String> URI_and_localNames) Implements com. Does nothing. The setting of CDATA section elements has an impact on stream serializers.
|
setContentHandler | back to summary |
---|---|
public void setContentHandler(ContentHandler _saxHandler) Implements com. Sets the SAX ContentHandler.
|
setLexHandler | back to summary |
---|---|
public void setLexHandler(LexicalHandler _lexHandler) Sets the LexicalHandler.
|
setShouldOutputNSAttr | back to summary |
---|---|
public void setShouldOutputNSAttr(boolean doOutputNSAttr) Set whether or not namespace declarations (e.g. xmlns:foo) should appear as attributes of elements
|
setTransformState | back to summary |
---|---|
public 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. This method will be called before each startDocument event.
|
startDocumentInternal | back to summary |
---|---|
protected void startDocumentInternal() throws SAXException Overrides com. Pass callback to the SAX Handler |
startDTD | back to summary |
---|---|
public void startDTD(String arg0, String arg1, String arg2) throws SAXException Implements org. Do nothing.
|
startElement | back to summary |
---|---|
public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException Implements org. 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.
|
startElement | back to summary |
---|---|
public void startElement(String uri, String localName, String qName) throws SAXException Implements com. Receives notification that an element starts, but attributes are not fully known yet.
|
startElement | back to summary |
---|---|
public void startElement(String qName) throws SAXException Implements com. An element starts, but attributes are not fully known yet.
|
warning | back to summary |
---|---|
public void warning(SAXParseException exc) throws SAXException Overrides com. Implements org. Doc from org. Receive notification of a warning. SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML recommendation. The default behaviour is to take no action. The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. Filters may use this method to report other, non-XML warnings as well.
|