Xindice API

org.apache.xindice.tools.command
Class StringSerializer

java.lang.Object
  |
  +--org.apache.xindice.tools.command.StringSerializer
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler

public class StringSerializer
extends java.lang.Object
implements org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler

SAX content handler that produces a string from the SAX events it receives. After calling endDocument(), the string becomes available by calling toString()

Version:
1
Author:
james.bates@amplexor.com

Constructor Summary
StringSerializer(java.lang.String outputEncoding)
          Creates new StringSerializer.
 
Method Summary
 void characters(char[] data, int start, int len)
           
 void comment(char[] data, int start, int len)
           
 void endCDATA()
           
 void endDocument()
           
 void endDTD()
           
 void endElement(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qName)
           
 void endEntity(java.lang.String entity)
           
 void endPrefixMapping(java.lang.String prefix)
           
 void ignorableWhitespace(char[] data, int start, int len)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void skippedEntity(java.lang.String entity)
           
 void startCDATA()
           
 void startDocument()
           
 void startDTD(java.lang.String docType, java.lang.String systemID, java.lang.String publicID)
           
 void startElement(java.lang.String namespaceUri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes att)
           
 void startEntity(java.lang.String entity)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringSerializer

public StringSerializer(java.lang.String outputEncoding)
Creates new StringSerializer.
Parameters:
outputEncoding - the encoding that should be written into the XML declaration for the document. This encoding is not used in any other way: when the resultant string is written to a file, the writing application must still take care to actually write using the correct encoding. If outputEncoding is null, the encoding will be omitted from the XML declaration.
Method Detail

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.ContentHandler

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.ContentHandler

processingInstruction

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

comment

public void comment(char[] data,
                    int start,
                    int len)
Specified by:
comment in interface org.xml.sax.ext.LexicalHandler

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler

ignorableWhitespace

public void ignorableWhitespace(char[] data,
                                int start,
                                int len)
Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler

startElement

public void startElement(java.lang.String namespaceUri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes att)
Specified by:
startElement in interface org.xml.sax.ContentHandler

endElement

public void endElement(java.lang.String namespaceUri,
                       java.lang.String localName,
                       java.lang.String qName)
Specified by:
endElement in interface org.xml.sax.ContentHandler

skippedEntity

public void skippedEntity(java.lang.String entity)
Specified by:
skippedEntity in interface org.xml.sax.ContentHandler

characters

public void characters(char[] data,
                       int start,
                       int len)
Specified by:
characters in interface org.xml.sax.ContentHandler

setDocumentLocator

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

startCDATA

public void startCDATA()
Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler

endCDATA

public void endCDATA()
              throws org.xml.sax.SAXException
Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler

startEntity

public void startEntity(java.lang.String entity)
Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler

endEntity

public void endEntity(java.lang.String entity)
Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler

startDTD

public void startDTD(java.lang.String docType,
                     java.lang.String systemID,
                     java.lang.String publicID)
Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler

endDTD

public void endDTD()
Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Xindice API

Copyright (c) 1999-2001 The Apache Software Foundation