oracle.xml.parser.v2

## Class XMLTokenizer

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

All Implemented Interfaces:
  XMLDocumentHandler, DocumentHandler, DTDHandler, EntityResolver, ErrorHandler

    public class XMLTokenizer
    extends DefaultXMLDocumentHandler

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

### Constructor Summary

Constructors
Constructor and Description
`XMLTokenizer()` Creates a new Tokenizer object.
`XMLTokenizer(XMLToken handler)` Creates a new Tokenizer object.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `parseDocument()` Parses an XML Document
`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

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.xml.sax.DocumentHandler

`characters, endDocument, endElement, ignorableWhitespace, processingInstruction, setDocumentLocator, startDocument, startElement`

### 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

Parses an XML Document

Throws:
  `SAXException` - Any SAX Exception, possibly wrapping another exception.
  `java.io.IOException` - IO Error.

Copyright © 2003, 2019, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms. Also see the documentation redistribution policy.
ORACLE CONFIDENTIAL
For authorized use only.
Do not distribute to third parties.