oracle.xml.parser.v2
Class XMLTokenizer

java.lang.Object
  |
  +--org.xml.sax.HandlerBase
        |
        +--oracle.xml.parser.v2.DefaultXMLDocumentHandler
              |
              +--oracle.xml.parser.v2.XMLTokenizer

public class XMLTokenizer
extends DefaultXMLDocumentHandler
implements XMLConstants

This class implements an eXtensible Markup Language (XML) 1.0 parser according to the World Wide Web Consortium (W3C) recommendation.


Fields inherited from interface oracle.xml.parser.v2.XMLConstants
AMP, ASTERISK, AUTO_VALIDATION, cANY, cATTLIST, cCDATA, cCDATAEND, cCDATASTART, cCOMMENTEND, cCOMMENTSTART, cDECCREF, cDECLSTART, cDOCTYPE, cELEMENT, cEMPTY, cEMPTYTAGEND, cENCODING, cENDTAGSTART, cENTITIES, cENTITY, cFIXED, cHEXCREF, cID, cIDREF, cIDREFS, cIGNORE, cIMPLIED, cINCLUDE, cNDATA, cNMTOKEN, cNMTOKENS, cNOTATION, COLON, COMMA, cPIEND, cPISTART, cPUBLIC, cREQUIRED, cSTANDALONE, cSYSTEM, cVERSION, cXML, DEFAULT_HASHSIZE_BIG, DEFAULT_HASHSIZE_SMALL, DEFAULT_PREFIX, DOUBLEQUOTE, DTD_VALIDATION, EOF, EQ, ERROR, EXT_GEN_ENTITY_FEATURE, EXT_PAR_ENTITY_FEATURE, FATAL_ERROR, FDIGIT, FLETTER, FMISCNAME, FSTARTNAME, FWHITESPACE, HASH, ICOUNT, ISTART, LEFTSQB, LPAREN, nameCDATA, nameCOMMENT, nameDOCUMENT, nameDOCUMENTFRAGMENT, nameENCODING, nameNameSpace, NAMESPACE_FEATURE, NAMESPACE_PREFIX_FEATURE, nameSpaceSeparator, nameSTANDALONE, nameTEXT, nameVERSION, nameXML, nameXMLLang, nameXMLNamespace, nameXMLNSNamespace, nameXMLSpace, nameXSLPI, NONVALIDATING, OR, PARTIAL_VALIDATION, PERCENT, PLUS, QMARK, QUOTE, RIGHTSQB, RPAREN, SCHEMA_LAX_VALIDATION, SCHEMA_STRICT_VALIDATION, SCHEMA_VALIDATION, SEMICOLON, SLASH, STRING_INTERN_FEATURE, TAGEND, TAGSTART, VALIDATION_FEATURE, WARNING
 
Constructor Summary
XMLTokenizer()
          Creates a new Tokenizer object.
XMLTokenizer(XMLToken handler)
          Creates a new Tokenizer object.
 
Method Summary
TypeMethod
 void parseDocument()
          Document ::= Prolog Element Misc*
 void setErrorHandler(ErrorHandler handler)
          Applications can use this to register a new error event handler.
 void setErrorStream(java.io.OutputStream out)
          Register a output stream for errors
 void setToken(int token, boolean val)
          Applications can use this to register a new token for XML tokenizer.
 void setTokenHandler(XMLToken handler)
          Applications can use this to register a new XML tokenizer event handler.
 void tokenize(InputSource in)
          Tokenizes the XML from given input source
 void tokenize(java.io.InputStream in)
          Tokenizes the XML from given input stream.
 void tokenize(java.io.Reader r)
          Tokenizes the XML from given input stream.
 void tokenize(java.lang.String in)
          Tokenizes the XML from the URL indicated
 void tokenize(java.net.URL url)
          Tokenizes the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.
 
Methods inherited from class oracle.xml.parser.v2.DefaultXMLDocumentHandler
cDATASection, comment, endDoctype, endElement, endElement, endPrefixMapping, getHandler, setDoctype, setError, setHandler, setTextDecl, setXMLDecl, setXMLSchema, skippedEntity, startElement, startElement, startPrefixMapping
 
Methods inherited from class org.xml.sax.HandlerBase
characters, endDocument, endElement, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, startElement, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLTokenizer

public XMLTokenizer()
Creates a new Tokenizer object.

XMLTokenizer

public XMLTokenizer(XMLToken handler)
Creates a new Tokenizer object.
Method Detail

setErrorStream

public void setErrorStream(java.io.OutputStream out)
Register a output stream for errors

setErrorHandler

public void setErrorHandler(ErrorHandler handler)
Applications can use this to register a new error event handler. This replaces any previous setting for error handling.
Parameters:
handler - ErrorHandler being registered

tokenize

public final void tokenize(java.net.URL url)
                    throws XMLParseException,
                           SAXException,
                           java.io.IOException
Tokenizes the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.
Parameters:
url - the url points to the XML document to parse.
Throws:
XMLParseException - if syntax or other error encountered.
SAXException - Any SAX exception, possibly wrapping another exception.
java.io.IOException - IO Error.

tokenize

public final void tokenize(InputSource in)
                    throws XMLParseException,
                           SAXException,
                           java.io.IOException
Tokenizes the XML from given input source
Parameters:
in - the org.xml.sax.InputSouce to parse
Throws:
XMLParseException - if syntax or other error encountered.
SAXException - Any SAX exception, possibly wrapping another exception.
java.io.IOException - IO Error.

tokenize

public final void tokenize(java.lang.String in)
                    throws XMLParseException,
                           SAXException,
                           java.io.IOException
Tokenizes the XML from the URL indicated
Parameters:
in - the String containing the URL to parse from
Throws:
XMLParseException - if syntax or other error encountered.
SAXException - Any SAX exception, possibly wrapping another exception.
java.io.IOException - IO Error.

tokenize

public final void tokenize(java.io.InputStream in)
                    throws XMLParseException,
                           SAXException,
                           java.io.IOException
Tokenizes the XML from given input stream.
Parameters:
in - the InputStream containing XML data to parse.
Throws:
XMLParseException - if syntax or other error encountered.
SAXException - Any SAX exception, possibly wrapping another exception.
java.io.IOException - IO Error.
See Also:
XMLParser.setBaseURL(java.net.URL)

tokenize

public final void tokenize(java.io.Reader r)
                    throws XMLParseException,
                           SAXException,
                           java.io.IOException
Tokenizes the XML from given input stream.
Parameters:
r - the Reader containing XML data to parse.
Throws:
XMLParseException - if syntax or other error encountered.
SAXException - Any SAX exception, possibly wrapping another exception.
java.io.IOException - IO Error.
See Also:
XMLParser.setBaseURL(java.net.URL)

setTokenHandler

public void setTokenHandler(XMLToken handler)
Applications can use this to register a new XML tokenizer event handler.
Parameters:
handler - XMLToken being registered

setToken

public void setToken(int token,
                     boolean val)
Applications can use this to register a new token for XML tokenizer.
Parameters:
token - XMLToken being set

parseDocument

public void parseDocument()
                   throws SAXException,
                          java.io.IOException
Document ::= Prolog Element Misc*