net.ontopia.xml
Class CanonicalPrinter

java.lang.Object
  extended by net.ontopia.xml.CanonicalPrinter
All Implemented Interfaces:
org.xml.sax.DocumentHandler
Direct Known Subclasses:
CanonicalTopicMapWriter.CanonicalXTMPrinter

public class CanonicalPrinter
extends java.lang.Object
implements org.xml.sax.DocumentHandler

INTERNAL: SAX document handler that prints canonical XML. Note that this does not support all of http://www.w3.org/TR/xml-c14n, only what is needed for Canonical XTM.


Field Summary
protected  java.io.PrintWriter writer
           
 
Constructor Summary
CanonicalPrinter(java.io.OutputStream stream)
          Creates a CanonicalPrinter that writes to the given OutputStream.
CanonicalPrinter(java.io.Writer writer)
          Creates a CanonicalPrinter that writes to the given Writer.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(java.lang.String name)
           
 java.lang.String escape(java.lang.String attrval)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void startDocument()
           
 void startElement(java.lang.String name, org.xml.sax.AttributeList atts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

writer

protected java.io.PrintWriter writer
Constructor Detail

CanonicalPrinter

public CanonicalPrinter(java.io.OutputStream stream)
                 throws java.io.UnsupportedEncodingException
Creates a CanonicalPrinter that writes to the given OutputStream. The encoding used is always utf-8.

Throws:
java.io.UnsupportedEncodingException

CanonicalPrinter

public CanonicalPrinter(java.io.Writer writer)
Creates a CanonicalPrinter that writes to the given Writer.

Method Detail

startDocument

public void startDocument()
Specified by:
startDocument in interface org.xml.sax.DocumentHandler

startElement

public void startElement(java.lang.String name,
                         org.xml.sax.AttributeList atts)
Specified by:
startElement in interface org.xml.sax.DocumentHandler

endElement

public void endElement(java.lang.String name)
Specified by:
endElement in interface org.xml.sax.DocumentHandler

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface org.xml.sax.DocumentHandler

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
Specified by:
ignorableWhitespace in interface org.xml.sax.DocumentHandler

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
Specified by:
processingInstruction in interface org.xml.sax.DocumentHandler

endDocument

public void endDocument()
Specified by:
endDocument in interface org.xml.sax.DocumentHandler

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Specified by:
setDocumentLocator in interface org.xml.sax.DocumentHandler

escape

public java.lang.String escape(java.lang.String attrval)


Copyright © 2000-2012 Ontopia.