| Method from com.sun.org.apache.xml.internal.serializer.ToSAXHandler Detail: |
public void addUniqueAttribute(String qName,
String value,
int flags) throws SAXException {
addAttribute(qName, value);
}
|
public void characters(String characters) throws SAXException {
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);
}
Receive notification of character data. |
public void characters(Node node) throws SAXException {
// 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);
}
}
This method gets the node's value as a String and uses that String as if
it were an input character notification. |
protected void closeCDATA() throws SAXException {
// Redefined in SAXXMLOutput
}
|
protected void closeStartTag() throws SAXException {
}
|
public void comment(String comment) throws SAXException {
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);
}
}
Receive notification of a comment. |
public void error(SAXParseException exc) throws SAXException {
super.error(exc);
if (m_saxHandler instanceof ErrorHandler)
((ErrorHandler)m_saxHandler).error(exc);
}
|
public void fatalError(SAXParseException exc) throws SAXException {
super.fatalError(exc);
m_needToCallStartDocument = false;
if (m_saxHandler instanceof ErrorHandler) {
((ErrorHandler)m_saxHandler).fatalError(exc);
}
}
|
public void flushPending() throws SAXException {
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;
}
}
This method flushes any pending events, which can be startDocument()
closing the opening tag of an element, or closing an open CDATA section. |
boolean getShouldOutputNSAttr() {
return m_shouldGenerateNSAttribute;
}
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 target,
String data) throws SAXException {
// Redefined in SAXXMLOutput
}
Do nothing as this is an abstract class. All subclasses will need to
define their behavior if it is different. |
public boolean reset() {
boolean wasReset = false;
if (super.reset())
{
resetToSAXHandler();
wasReset = true;
}
return wasReset;
}
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). |
public void setCdataSectionElements(Vector URI_and_localNames) {
// do nothing
}
Does nothing. The setting of CDATA section elements has an impact on
stream serializers. |
public void setContentHandler(ContentHandler _saxHandler) {
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;
}
}
Sets the SAX ContentHandler. |
public void setLexHandler(LexicalHandler _lexHandler) {
this.m_lexHandler = _lexHandler;
}
|
public void setShouldOutputNSAttr(boolean doOutputNSAttr) {
m_shouldGenerateNSAttribute = doOutputNSAttr;
}
Set whether or not namespace declarations (e.g.
xmlns:foo) should appear as attributes of
elements |
public void setTransformState(TransformStateSetter ts) {
this.m_state = 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. |
public void startDTD(String arg0,
String arg1,
String arg2) throws SAXException {
// do nothing for now
}
|
protected void startDocumentInternal() throws SAXException {
if (m_needToCallStartDocument)
{
super.startDocumentInternal();
m_saxHandler.startDocument();
m_needToCallStartDocument = false;
}
}
Pass callback to the SAX Handler |
public void startElement(String qName) throws SAXException {
if (m_state != null) {
m_state.resetState(getTransformer());
}
// fire off the start element event
if (m_tracer != null)
super.fireStartElem(qName);
}
An element starts, but attributes are not fully known yet. |
public void startElement(String uri,
String localName,
String qName) throws SAXException {
if (m_state != null) {
m_state.resetState(getTransformer());
}
// fire off the start element event
if (m_tracer != null)
super.fireStartElem(qName);
}
Receives notification that an element starts, but attributes are not
fully known yet. |
public void startElement(String arg0,
String arg1,
String arg2,
Attributes arg3) throws SAXException {
if (m_state != null) {
m_state.resetState(getTransformer());
}
// fire off the start element event
if (m_tracer != null)
super.fireStartElem(arg2);
}
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 warning(SAXParseException exc) throws SAXException {
super.warning(exc);
if (m_saxHandler instanceof ErrorHandler)
((ErrorHandler)m_saxHandler).warning(exc);
}
|