com.jclark.xsl.sax
Class ResultBase

java.lang.Object
  |
  +--com.jclark.xsl.sax.ResultBase
All Implemented Interfaces:
org.xml.sax.AttributeList, Result
Direct Known Subclasses:
MultiNamespaceResult

public abstract class ResultBase
extends java.lang.Object
implements Result, org.xml.sax.AttributeList

abstract base class represents the results of executing a stylesheet Action -- constructs result components. events are fired to the Result, which in turn fires events to a SAX (1) DocumentHandler


Method Summary
 void attribute(Name name, java.lang.String value)
          construct an Attribute with the given name ...
 void characters(java.lang.String str)
          construct some characters in the result
 void comment(java.lang.String str)
          construct a comment in our result
 void end()
          flush any pending construction work, nothing else will be built
 void endElement(Name elementType)
           
protected abstract  void endElementContent(Name elementType)
           
 void flush()
          call this when we're sure we're not getting any more attribute node constructing actions
protected  Name getAttributeName(int i)
           
protected  org.xml.sax.DocumentHandler getDocumentHandler()
           
 int getLength()
           
 java.lang.String getType(int i)
           
 java.lang.String getType(java.lang.String name)
           
 java.lang.String getValue(int i)
           
 java.lang.String getValue(java.lang.String name)
           
 void message(Node node, java.lang.String str)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
          construct a processingInstruction in the result
 void rawCharacters(java.lang.String str)
          rawCharacters are distinct from plain 'ol characters in that we don't try to do any escaping
abstract  void resultTreeFragment(ResultTreeFragment frag)
           
 void start(OutputMethod outputMethod)
          initialize, (and possibly construct) the DocumentHandler
 void startElement(Name elementType, NamespacePrefixMap nsMap)
          start construction an Element
protected abstract  void startElementContent(Name elementType, NamespacePrefixMap nsMap)
          we're finished with adding attributes?
protected  void throwXSLException(org.xml.sax.SAXException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jclark.xsl.tr.Result
createResult
 
Methods inherited from interface org.xml.sax.AttributeList
getName
 

Method Detail

flush

public void flush()
           throws XSLException
call this when we're sure we're not getting any more attribute node constructing actions

rawCharacters

public void rawCharacters(java.lang.String str)
                   throws XSLException
rawCharacters are distinct from plain 'ol characters in that we don't try to do any escaping
Specified by:
rawCharacters in interface Result

characters

public void characters(java.lang.String str)
                throws XSLException
construct some characters in the result
Specified by:
characters in interface Result

comment

public void comment(java.lang.String str)
             throws XSLException
construct a comment in our result
Specified by:
comment in interface Result

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws XSLException
construct a processingInstruction in the result
Specified by:
processingInstruction in interface Result

startElement

public void startElement(Name elementType,
                         NamespacePrefixMap nsMap)
                  throws XSLException
start construction an Element
Specified by:
startElement in interface Result

endElement

public void endElement(Name elementType)
                throws XSLException
Specified by:
endElement in interface Result

getDocumentHandler

protected final org.xml.sax.DocumentHandler getDocumentHandler()

getLength

public int getLength()
Specified by:
getLength in interface org.xml.sax.AttributeList
Returns:
the number of attribute nodes we have at this moment

getAttributeName

protected final Name getAttributeName(int i)
Returns:
the name of the i'th Attribute

getValue

public java.lang.String getValue(int i)
Specified by:
getValue in interface org.xml.sax.AttributeList
Returns:
the value of the i'th Attribute

getType

public java.lang.String getType(int i)
Specified by:
getType in interface org.xml.sax.AttributeList
Returns:
the type of the i'th Attribute (always "CDATA")

getType

public java.lang.String getType(java.lang.String name)
Specified by:
getType in interface org.xml.sax.AttributeList
Returns:
the type of the named Attribute (always "CDATA")

getValue

public java.lang.String getValue(java.lang.String name)
Specified by:
getValue in interface org.xml.sax.AttributeList
Returns:
the value of the named Attribute (always "CDATA") .. not sure how these names work with namespaces returns null if the named Attribute is not found

startElementContent

protected abstract void startElementContent(Name elementType,
                                            NamespacePrefixMap nsMap)
                                     throws XSLException
we're finished with adding attributes?

endElementContent

protected abstract void endElementContent(Name elementType)
                                   throws XSLException

attribute

public void attribute(Name name,
                      java.lang.String value)
               throws XSLException
construct an Attribute with the given name ... if we're not at an appropriate point, eg, we've already started putting text into an element, do nothing
Specified by:
attribute in interface Result

start

public void start(OutputMethod outputMethod)
           throws XSLException
initialize, (and possibly construct) the DocumentHandler
Specified by:
start in interface Result

end

public void end()
         throws XSLException
flush any pending construction work, nothing else will be built
Specified by:
end in interface Result

throwXSLException

protected void throwXSLException(org.xml.sax.SAXException e)
                          throws XSLException

resultTreeFragment

public abstract void resultTreeFragment(ResultTreeFragment frag)
                                 throws XSLException

message

public void message(Node node,
                    java.lang.String str)
             throws XSLException
Specified by:
message in interface Result