net.sf.swan.xml.output
Class DocumentResult

java.lang.Object
  |
  +--net.sf.swan.xml.output.Result
        |
        +--net.sf.swan.xml.output.ContainerResult
              |
              +--net.sf.swan.xml.output.FragmentResult
                    |
                    +--net.sf.swan.xml.output.DocumentResult

public class DocumentResult
extends FragmentResult

Specialized FragmentResult that emits startDocument and endDocument events to the ContentHandler. It also enforces a few additional constraints necessary for well-formed documents, such as only allowing one root element and disallowing content after the root element.


Inner classes inherited from class net.sf.swan.xml.output.ContainerResult
ContainerResult.NamespaceBinding
 
Fields inherited from class net.sf.swan.xml.output.ContainerResult
namespacePrefixMap, namespaceUriMap, stopChild
 
Fields inherited from class net.sf.swan.xml.output.Result
END_OUTPUT, NO_OUTPUT, outputState, parent, START_OUTPUT
 
Constructor Summary
DocumentResult(org.xml.sax.ContentHandler handler, org.xml.sax.ext.LexicalHandler lexicalHandler)
           
DocumentResult(org.xml.sax.ContentHandler handler, org.xml.sax.ext.LexicalHandler lexicalHandler, org.xml.sax.Locator locator)
           
 
Method Summary
protected  ElementResult element(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
           
 java.lang.String getLocationString()
          Provides an identifying string for the result node.
protected  void getLocationString(java.lang.StringBuffer buffer)
           
protected  void output(org.xml.sax.ContentHandler handler, org.xml.sax.ext.LexicalHandler lexicalHandler, boolean emitNamespaceAttrs)
           
protected  void startOutput(org.xml.sax.ContentHandler handler, org.xml.sax.ext.LexicalHandler lexicalHandler, boolean emitNamespaceAttrs)
           
protected  void verifyAllowChild()
           
 
Methods inherited from class net.sf.swan.xml.output.FragmentResult
end, getEmitNamespaceAttributes, namespace, output, setEmitNamespaceAttributes, startOutput, xmlns
 
Methods inherited from class net.sf.swan.xml.output.ContainerResult
cdata, comment, element, element, element, element, flush, getNamespacePrefix, outputChildren, processingInstruction, resolveNamespacePrefix, text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentResult

public DocumentResult(org.xml.sax.ContentHandler handler,
                      org.xml.sax.ext.LexicalHandler lexicalHandler)

DocumentResult

public DocumentResult(org.xml.sax.ContentHandler handler,
                      org.xml.sax.ext.LexicalHandler lexicalHandler,
                      org.xml.sax.Locator locator)
Method Detail

output

protected void output(org.xml.sax.ContentHandler handler,
                      org.xml.sax.ext.LexicalHandler lexicalHandler,
                      boolean emitNamespaceAttrs)
               throws java.io.IOException,
                      org.xml.sax.SAXException
Overrides:
output in class ContainerResult

startOutput

protected void startOutput(org.xml.sax.ContentHandler handler,
                           org.xml.sax.ext.LexicalHandler lexicalHandler,
                           boolean emitNamespaceAttrs)
                    throws java.io.IOException,
                           org.xml.sax.SAXException
Overrides:
startOutput in class ContainerResult

element

protected ElementResult element(java.lang.String namespaceUri,
                                java.lang.String localName,
                                java.lang.String qName,
                                org.xml.sax.Attributes atts)
                         throws org.xml.sax.SAXException
Overrides:
element in class FragmentResult

verifyAllowChild

protected void verifyAllowChild()
                         throws org.xml.sax.SAXException
Overrides:
verifyAllowChild in class ContainerResult

getLocationString

public java.lang.String getLocationString()
Description copied from class: Result
Provides an identifying string for the result node.
Overrides:
getLocationString in class ContainerResult

getLocationString

protected void getLocationString(java.lang.StringBuffer buffer)
Overrides:
getLocationString in class FragmentResult