com.jclark.xsl.sax

Class ResultBase

Implemented Interfaces:
AttributeList, Result
Known Direct Subclasses:
MultiNamespaceResult

public abstract class ResultBase
extends java.lang.Object
implements Result, 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

Field Summary

(package private) ErrorHandler
errorHandler
(package private) OutputMethodHandler
outputMethodHandler

Constructor Summary

ResultBase(DocumentHandler documentHandler, ErrorHandler errorHandler)
Construct with a DocummentHandler already determined
ResultBase(OutputMethodHandler outputMethodHandler, ErrorHandler errorHandler)
Construct with an outputMethodHandler from which we'll obtain the appropriate DocumentHandler

Method Summary

void
attribute(Name name, String value)
construct an Attribute with the given name ...
void
characters(String str)
construct some characters in the result
void
comment(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 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 DocumentHandler
getDocumentHandler()
int
getLength()
String
getType(String name)
String
getType(int i)
String
getValue(String name)
String
getValue(int i)
(package private) static String[]
grow(String[] v)
(package private) static Name[]
grow(Name[] v)
void
message(Node node, String str)
void
processingInstruction(String target, String data)
construct a processingInstruction in the result
void
rawCharacters(String str)
rawCharacters are distinct from plain 'ol characters in that we don't try to do any escaping
void
resultTreeFragment(ResultTreeFragment frag)
(package private) DocumentHandler
setOutputMethod(Name name, OutputMethod method)
get the appropriate DocumentHandler from the outputMethodHandler (we've already obtained for our destiantion) for the named output method
void
start(OutputMethod outputMethod)
initialize, (and possibly construct) the DocumentHandler
void
startElement(Name elementType, NamespacePrefixMap nsMap)
start construction an Element
protected void
startElementContent(Name elementType, NamespacePrefixMap nsMap)
we're finished with adding attributes?
protected void
throwXSLException(SAXException e)

Field Details

errorHandler

(package private)  ErrorHandler errorHandler


outputMethodHandler

(package private)  OutputMethodHandler outputMethodHandler

Constructor Details

ResultBase

(package private)  ResultBase(DocumentHandler documentHandler,
                              ErrorHandler errorHandler)
Construct with a DocummentHandler already determined


ResultBase

(package private)  ResultBase(OutputMethodHandler outputMethodHandler,
                              ErrorHandler errorHandler)
Construct with an outputMethodHandler from which we'll obtain the appropriate DocumentHandler

Method Details

attribute

public void attribute(Name name,
                      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


characters

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


comment

public void comment(String str)
            throws XSLException
construct a comment in our result
Specified by:
comment 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


endElement

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


endElementContent

protected void endElementContent(Name elementType)
            throws XSLException


flush

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


getAttributeName

protected final Name getAttributeName(int i)

Returns:
the name of the i'th Attribute


getDocumentHandler

protected final DocumentHandler getDocumentHandler()


getLength

public int getLength()

Returns:
the number of attribute nodes we have at this moment


getType

public String getType(String name)

Returns:
the type of the named Attribute (always "CDATA")


getType

public String getType(int i)

Returns:
the type of the i'th Attribute (always "CDATA")


getValue

public String getValue(String name)

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


getValue

public String getValue(int i)

Returns:
the value of the i'th Attribute


grow

(package private) static String[] grow(String[] v)


grow

(package private) static Name[] grow(Name[] v)


message

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


processingInstruction

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


rawCharacters

public void rawCharacters(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


resultTreeFragment

public void resultTreeFragment(ResultTreeFragment frag)
            throws XSLException


setOutputMethod

(package private)  DocumentHandler setOutputMethod(Name name,
                                                   OutputMethod method)
            throws IOException,
                   SAXException
get the appropriate DocumentHandler from the outputMethodHandler (we've already obtained for our destiantion) for the named output method


start

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


startElement

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


startElementContent

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


throwXSLException

protected void throwXSLException(SAXException e)
            throws XSLException