com.bluecast.xml
Class Piccolo

java.lang.Object
  extended by com.bluecast.xml.Piccolo
All Implemented Interfaces:
org.xml.sax.Locator, org.xml.sax.Parser, org.xml.sax.XMLReader

public class Piccolo
extends java.lang.Object
implements org.xml.sax.Parser, org.xml.sax.Locator, org.xml.sax.XMLReader

Piccolo is a small, high-performance SAX1 and SAX2 XML parser. As per the SAX2 specification, namespace handling is on by default. You can improve performance by turning it off. Note that if used in SAX1 mode, namespace handling is automatically turned off.


Field Summary
static short ANY
           
static short ATTLIST_START
           
static short CDATA
           
static short CLOSE_TAG
           
static short COMMA
           
static short COMMENT
           
static short CONDITIONAL_START
           
static short DOUBLE_RBRACKET_END
           
static short DTD_START
           
static short DTD_START_SKIPEXTERNAL
           
static short ELEMENT_DECL_START
           
static short EMPTY
           
static short EMPTY_TAG
           
static short ENTITIES
           
static short ENTITY
           
static short ENTITY_DECL_START
           
static short ENTITY_END
           
static short ENTITY_REF
           
static short ENUMERATION
           
static short EQ
           
static short EXTERNAL_ENTITY_REF
           
static short FIXED
           
static short ID
           
static short IDREF
           
static short IDREFS
           
static short IGNORE
           
static short IGNORED_CONDITIONAL_START
           
static short IMPLIED
           
static short INCLUDE
           
static short INTERNAL_ENTITY_REF
           
static short LBRACKET
           
static short LPAREN
           
static short MODIFIER
           
static short NAME
           
static short NDATA
           
static short NMTOKEN
           
static short NMTOKENS
           
static short NOTATION
           
static short NOTATION_START
           
static short OPEN_TAG
           
static short PCDATA
           
static short PERCENT
           
static short PI
           
static short PIPE
           
static short PLUS
           
static short PREFIXED_NAME
           
static short PUBLIC
           
static short QUESTION
           
static short RBRACKET_END
           
static short REQUIRED
           
static short RPAREN
           
static short SKIPPED_ENTITY_REF
           
static short STAR
           
static short STRING
           
static short SYSTEM
           
static short TAG_END
           
static short UNPREFIXED_NAME
           
static short WHITESPACE
           
static short XML_DOC_DECL
           
static short XML_DOC_OR_TEXT_DECL
           
static short XML_TEXT_DECL
           
static short YYERRCODE
           
 
Constructor Summary
Piccolo()
           
Piccolo(Piccolo template)
          Create an instance with the same configuration as the given instance.
 
Method Summary
 int getColumnNumber()
           
 org.xml.sax.ContentHandler getContentHandler()
          SAX2 methods
 org.xml.sax.DTDHandler getDTDHandler()
           
 java.lang.String getEncoding()
           
 org.xml.sax.EntityResolver getEntityResolver()
           
 org.xml.sax.ErrorHandler getErrorHandler()
           
 boolean getFeature(java.lang.String name)
           
 int getLineNumber()
           
 java.lang.Object getProperty(java.lang.String name)
           
 java.lang.String getPublicId()
           
 org.xml.sax.Locator getStartLocator()
           
 java.lang.String getSystemId()
           
 java.lang.String getVersion()
           
 void parse(org.xml.sax.InputSource source)
          Methods common to both SAX1 and SAX2
 void parse(java.lang.String sysID)
           
 void setContentHandler(org.xml.sax.ContentHandler handler)
           
 void setDebug(boolean debug)
           
 void setDocumentHandler(org.xml.sax.DocumentHandler handler)
          SAX1 methods
 void setDTDHandler(org.xml.sax.DTDHandler handler)
           
 void setEntityResolver(org.xml.sax.EntityResolver resolver)
           
 void setErrorHandler(org.xml.sax.ErrorHandler handler)
           
 void setFeature(java.lang.String name, boolean value)
           
 void setLocale(java.util.Locale locale)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CDATA

public static final short CDATA
See Also:
Constant Field Values

TAG_END

public static final short TAG_END
See Also:
Constant Field Values

PI

public static final short PI
See Also:
Constant Field Values

NAME

public static final short NAME
See Also:
Constant Field Values

STRING

public static final short STRING
See Also:
Constant Field Values

EQ

public static final short EQ
See Also:
Constant Field Values

OPEN_TAG

public static final short OPEN_TAG
See Also:
Constant Field Values

CLOSE_TAG

public static final short CLOSE_TAG
See Also:
Constant Field Values

EMPTY_TAG

public static final short EMPTY_TAG
See Also:
Constant Field Values

WHITESPACE

public static final short WHITESPACE
See Also:
Constant Field Values

DTD_START

public static final short DTD_START
See Also:
Constant Field Values

DTD_START_SKIPEXTERNAL

public static final short DTD_START_SKIPEXTERNAL
See Also:
Constant Field Values

SYSTEM

public static final short SYSTEM
See Also:
Constant Field Values

PUBLIC

public static final short PUBLIC
See Also:
Constant Field Values

REQUIRED

public static final short REQUIRED
See Also:
Constant Field Values

IMPLIED

public static final short IMPLIED
See Also:
Constant Field Values

FIXED

public static final short FIXED
See Also:
Constant Field Values

LPAREN

public static final short LPAREN
See Also:
Constant Field Values

RPAREN

public static final short RPAREN
See Also:
Constant Field Values

LBRACKET

public static final short LBRACKET
See Also:
Constant Field Values

PIPE

public static final short PIPE
See Also:
Constant Field Values

ENTITY_DECL_START

public static final short ENTITY_DECL_START
See Also:
Constant Field Values

ATTLIST_START

public static final short ATTLIST_START
See Also:
Constant Field Values

NOTATION_START

public static final short NOTATION_START
See Also:
Constant Field Values

RBRACKET_END

public static final short RBRACKET_END
See Also:
Constant Field Values

DOUBLE_RBRACKET_END

public static final short DOUBLE_RBRACKET_END
See Also:
Constant Field Values

PERCENT

public static final short PERCENT
See Also:
Constant Field Values

ENUMERATION

public static final short ENUMERATION
See Also:
Constant Field Values

NOTATION

public static final short NOTATION
See Also:
Constant Field Values

ID

public static final short ID
See Also:
Constant Field Values

IDREF

public static final short IDREF
See Also:
Constant Field Values

IDREFS

public static final short IDREFS
See Also:
Constant Field Values

ENTITY

public static final short ENTITY
See Also:
Constant Field Values

ENTITIES

public static final short ENTITIES
See Also:
Constant Field Values

NMTOKEN

public static final short NMTOKEN
See Also:
Constant Field Values

NMTOKENS

public static final short NMTOKENS
See Also:
Constant Field Values

ENTITY_REF

public static final short ENTITY_REF
See Also:
Constant Field Values

ENTITY_END

public static final short ENTITY_END
See Also:
Constant Field Values

INTERNAL_ENTITY_REF

public static final short INTERNAL_ENTITY_REF
See Also:
Constant Field Values

EXTERNAL_ENTITY_REF

public static final short EXTERNAL_ENTITY_REF
See Also:
Constant Field Values

SKIPPED_ENTITY_REF

public static final short SKIPPED_ENTITY_REF
See Also:
Constant Field Values

PREFIXED_NAME

public static final short PREFIXED_NAME
See Also:
Constant Field Values

UNPREFIXED_NAME

public static final short UNPREFIXED_NAME
See Also:
Constant Field Values

NDATA

public static final short NDATA
See Also:
Constant Field Values

COMMENT

public static final short COMMENT
See Also:
Constant Field Values

CONDITIONAL_START

public static final short CONDITIONAL_START
See Also:
Constant Field Values

IGNORED_CONDITIONAL_START

public static final short IGNORED_CONDITIONAL_START
See Also:
Constant Field Values

INCLUDE

public static final short INCLUDE
See Also:
Constant Field Values

IGNORE

public static final short IGNORE
See Also:
Constant Field Values

MODIFIER

public static final short MODIFIER
See Also:
Constant Field Values

PCDATA

public static final short PCDATA
See Also:
Constant Field Values

ELEMENT_DECL_START

public static final short ELEMENT_DECL_START
See Also:
Constant Field Values

EMPTY

public static final short EMPTY
See Also:
Constant Field Values

ANY

public static final short ANY
See Also:
Constant Field Values

STAR

public static final short STAR
See Also:
Constant Field Values

COMMA

public static final short COMMA
See Also:
Constant Field Values

QUESTION

public static final short QUESTION
See Also:
Constant Field Values

PLUS

public static final short PLUS
See Also:
Constant Field Values

XML_DOC_DECL

public static final short XML_DOC_DECL
See Also:
Constant Field Values

XML_TEXT_DECL

public static final short XML_TEXT_DECL
See Also:
Constant Field Values

XML_DOC_OR_TEXT_DECL

public static final short XML_DOC_OR_TEXT_DECL
See Also:
Constant Field Values

YYERRCODE

public static final short YYERRCODE
See Also:
Constant Field Values
Constructor Detail

Piccolo

public Piccolo()

Piccolo

public Piccolo(Piccolo template)
Create an instance with the same configuration as the given instance. ContentHandler, DTDHandler, etc. will not be copied.

Method Detail

setDebug

public void setDebug(boolean debug)

parse

public void parse(org.xml.sax.InputSource source)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Methods common to both SAX1 and SAX2

Specified by:
parse in interface org.xml.sax.Parser
Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
java.io.IOException
org.xml.sax.SAXException

parse

public void parse(java.lang.String sysID)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Specified by:
parse in interface org.xml.sax.Parser
Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
java.io.IOException
org.xml.sax.SAXException

setDocumentHandler

public void setDocumentHandler(org.xml.sax.DocumentHandler handler)
SAX1 methods

Specified by:
setDocumentHandler in interface org.xml.sax.Parser

setDTDHandler

public void setDTDHandler(org.xml.sax.DTDHandler handler)
Specified by:
setDTDHandler in interface org.xml.sax.Parser
Specified by:
setDTDHandler in interface org.xml.sax.XMLReader

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver resolver)
Specified by:
setEntityResolver in interface org.xml.sax.Parser
Specified by:
setEntityResolver in interface org.xml.sax.XMLReader

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler handler)
Specified by:
setErrorHandler in interface org.xml.sax.Parser
Specified by:
setErrorHandler in interface org.xml.sax.XMLReader

setLocale

public void setLocale(java.util.Locale locale)
               throws org.xml.sax.SAXException
Specified by:
setLocale in interface org.xml.sax.Parser
Throws:
org.xml.sax.SAXException

getColumnNumber

public int getColumnNumber()
Specified by:
getColumnNumber in interface org.xml.sax.Locator

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface org.xml.sax.Locator

getPublicId

public java.lang.String getPublicId()
Specified by:
getPublicId in interface org.xml.sax.Locator

getSystemId

public java.lang.String getSystemId()
Specified by:
getSystemId in interface org.xml.sax.Locator

getStartLocator

public org.xml.sax.Locator getStartLocator()

getVersion

public java.lang.String getVersion()

getEncoding

public java.lang.String getEncoding()

getContentHandler

public org.xml.sax.ContentHandler getContentHandler()
SAX2 methods

Specified by:
getContentHandler in interface org.xml.sax.XMLReader

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler handler)
Specified by:
setContentHandler in interface org.xml.sax.XMLReader

getDTDHandler

public org.xml.sax.DTDHandler getDTDHandler()
Specified by:
getDTDHandler in interface org.xml.sax.XMLReader

getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()
Specified by:
getEntityResolver in interface org.xml.sax.XMLReader

getErrorHandler

public org.xml.sax.ErrorHandler getErrorHandler()
Specified by:
getErrorHandler in interface org.xml.sax.XMLReader

getFeature

public boolean getFeature(java.lang.String name)
                   throws org.xml.sax.SAXNotSupportedException,
                          org.xml.sax.SAXNotRecognizedException
Specified by:
getFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotSupportedException
org.xml.sax.SAXNotRecognizedException

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
                throws org.xml.sax.SAXNotSupportedException,
                       org.xml.sax.SAXNotRecognizedException
Specified by:
setFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotSupportedException
org.xml.sax.SAXNotRecognizedException

getProperty

public java.lang.Object getProperty(java.lang.String name)
                             throws org.xml.sax.SAXNotRecognizedException,
                                    org.xml.sax.SAXNotSupportedException
Specified by:
getProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws org.xml.sax.SAXNotRecognizedException,
                        org.xml.sax.SAXNotSupportedException
Specified by:
setProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException