Methods Summary |
---|
public void | addUniqueAttribute(java.lang.String qName, java.lang.String value, int flags)Add a unique attribute
addAttribute(qName, value);
|
public void | characters(org.w3c.dom.Node node)This method gets the node's value as a String and uses that String as if
it were an input character notification.
// remember the current node
if (m_state != null)
{
m_state.setCurrentNode(node);
}
// Get the node's value as a String and use that String as if
// it were an input character notification.
String data = node.getNodeValue();
if (data != null) {
this.characters(data);
}
|
public void | characters(java.lang.String characters)Receive notification of character data.
final int len = characters.length();
if (len > m_charsBuff.length)
{
m_charsBuff = new char[len*2 + 1];
}
characters.getChars(0,len, m_charsBuff, 0);
characters(m_charsBuff, 0, len);
|
protected void | closeCDATA()
// Redefined in SAXXMLOutput
|
protected void | closeStartTag()
|
public void | comment(java.lang.String comment)Receive notification of a comment.
flushPending();
// Ignore if a lexical handler has not been set
if (m_lexHandler != null)
{
final int len = comment.length();
if (len > m_charsBuff.length)
{
m_charsBuff = new char[len*2 + 1];
}
comment.getChars(0,len, m_charsBuff, 0);
m_lexHandler.comment(m_charsBuff, 0, len);
// time to fire off comment event
if (m_tracer != null)
super.fireCommentEvent(m_charsBuff, 0, len);
}
|
public void | error(org.xml.sax.SAXParseException exc)
super.error(exc);
if (m_saxHandler instanceof ErrorHandler)
((ErrorHandler)m_saxHandler).error(exc);
|
public void | fatalError(org.xml.sax.SAXParseException exc)
super.fatalError(exc);
m_needToCallStartDocument = false;
if (m_saxHandler instanceof ErrorHandler) {
((ErrorHandler)m_saxHandler).fatalError(exc);
}
|
public 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.
if (m_needToCallStartDocument)
{
startDocumentInternal();
m_needToCallStartDocument = false;
}
if (m_elemContext.m_startTagOpen)
{
closeStartTag();
m_elemContext.m_startTagOpen = false;
}
if (m_cdataTagOpen)
{
closeCDATA();
m_cdataTagOpen = false;
}
|
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"
return m_shouldGenerateNSAttribute;
|
public void | processingInstruction(java.lang.String target, java.lang.String data)Do nothing as this is an abstract class. All subclasses will need to
define their behavior if it is different.
// Redefined in SAXXMLOutput
|
public 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).
boolean wasReset = false;
if (super.reset())
{
resetToSAXHandler();
wasReset = true;
}
return wasReset;
|
private void | resetToSAXHandler()Reset all of the fields owned by ToSAXHandler class
this.m_lexHandler = null;
this.m_saxHandler = null;
this.m_state = null;
this.m_shouldGenerateNSAttribute = false;
|
public void | setCdataSectionElements(java.util.Vector URI_and_localNames)Does nothing. The setting of CDATA section elements has an impact on
stream serializers.
// do nothing
|
public void | setContentHandler(org.xml.sax.ContentHandler _saxHandler)Sets the SAX ContentHandler.
this.m_saxHandler = _saxHandler;
if (m_lexHandler == null && _saxHandler instanceof LexicalHandler)
{
// we are not overwriting an existing LexicalHandler, and _saxHandler
// is also implements LexicalHandler, so lets use it
m_lexHandler = (LexicalHandler) _saxHandler;
}
|
public void | setLexHandler(org.xml.sax.ext.LexicalHandler _lexHandler)Sets the LexicalHandler.
this.m_lexHandler = _lexHandler;
|
public void | setShouldOutputNSAttr(boolean doOutputNSAttr)Set whether or not namespace declarations (e.g.
xmlns:foo) should appear as attributes of
elements
m_shouldGenerateNSAttribute = doOutputNSAttr;
|
public void | setTransformState(com.sun.org.apache.xml.internal.serializer.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.
this.m_state = ts;
|
public void | startDTD(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2)Do nothing.
// do nothing for now
|
protected void | startDocumentInternal()Pass callback to the SAX Handler
if (m_needToCallStartDocument)
{
super.startDocumentInternal();
m_saxHandler.startDocument();
m_needToCallStartDocument = false;
}
|
public void | startElement(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, org.xml.sax.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.
if (m_state != null) {
m_state.resetState(getTransformer());
}
// fire off the start element event
if (m_tracer != null)
super.fireStartElem(arg2);
|
public void | startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)Receives notification that an element starts, but attributes are not
fully known yet.
if (m_state != null) {
m_state.resetState(getTransformer());
}
// fire off the start element event
if (m_tracer != null)
super.fireStartElem(qName);
|
public void | startElement(java.lang.String qName)An element starts, but attributes are not fully known yet.
if (m_state != null) {
m_state.resetState(getTransformer());
}
// fire off the start element event
if (m_tracer != null)
super.fireStartElem(qName);
|
public void | warning(org.xml.sax.SAXParseException exc)
super.warning(exc);
if (m_saxHandler instanceof ErrorHandler)
((ErrorHandler)m_saxHandler).warning(exc);
|