com.caucho.xml.readers
Class XmlReader

java.lang.Object
  extended by com.caucho.xml.readers.XmlReader
Direct Known Subclasses:
MacroReader, Utf16Reader, Utf8Reader

public class XmlReader
extends java.lang.Object

A fast reader to convert bytes to characters for parsing XML.


Field Summary
protected  java.lang.String _filename
           
protected  ReadStream _is
           
protected  int _line
           
protected  XmlReader _next
           
protected  XmlParser _parser
           
protected  java.lang.String _publicId
           
protected  Path _searchPath
           
protected  java.lang.String _systemId
           
protected static boolean[] isAsciiNameChar
           
 
Constructor Summary
XmlReader()
          Create a new reader.
XmlReader(XmlParser parser, ReadStream is)
          Create a new reader with the given read stream.
 
Method Summary
 void finish()
          Finish reading.
 java.lang.String getFilename()
          Gets the filename.
 int getLine()
          Gets the current line number.
 XmlReader getNext()
          Sets the next reader.
 java.lang.String getPublicId()
          Gets the publicId.
 ReadStream getReadStream()
          Returns the read stream.
 Path getSearchPath()
          Gets the current search path.
 java.lang.String getSystemId()
          Gets the systemId.
 void init(XmlParser parser, ReadStream is)
          Initialize a reader at the start of parsing.
 int parseName(CharBuffer name, int ch)
          Parses a name.
 int read()
          Read the next character, returning -1 on end of file..
 void setFilename(java.lang.String filename)
          Sets the filename.
 void setLine(int line)
          Sets the current line number.
 void setNext(XmlReader next)
          Sets the next reader.
 void setPublicId(java.lang.String publicId)
          Sets the publicId.
 void setSearchPath(Path searchPath)
          Sets the current search path.
 void setSystemId(java.lang.String systemId)
          Sets the systemId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isAsciiNameChar

protected static boolean[] isAsciiNameChar

_parser

protected XmlParser _parser

_next

protected XmlReader _next

_searchPath

protected Path _searchPath

_is

protected ReadStream _is

_filename

protected java.lang.String _filename

_line

protected int _line

_systemId

protected java.lang.String _systemId

_publicId

protected java.lang.String _publicId
Constructor Detail

XmlReader

public XmlReader()
Create a new reader.


XmlReader

public XmlReader(XmlParser parser,
                 ReadStream is)
Create a new reader with the given read stream.

Method Detail

init

public void init(XmlParser parser,
                 ReadStream is)
Initialize a reader at the start of parsing.


setFilename

public void setFilename(java.lang.String filename)
Sets the filename.


getFilename

public java.lang.String getFilename()
Gets the filename.


setLine

public void setLine(int line)
Sets the current line number.


getLine

public int getLine()
Gets the current line number.


setSystemId

public void setSystemId(java.lang.String systemId)
Sets the systemId.


getSystemId

public java.lang.String getSystemId()
Gets the systemId.


setPublicId

public void setPublicId(java.lang.String publicId)
Sets the publicId.


getPublicId

public java.lang.String getPublicId()
Gets the publicId.


setSearchPath

public void setSearchPath(Path searchPath)
Sets the current search path.


getSearchPath

public Path getSearchPath()
Gets the current search path.


setNext

public void setNext(XmlReader next)
Sets the next reader.


getNext

public XmlReader getNext()
Sets the next reader.


getReadStream

public ReadStream getReadStream()
Returns the read stream.


read

public int read()
         throws java.io.IOException
Read the next character, returning -1 on end of file..

Throws:
java.io.IOException

parseName

public int parseName(CharBuffer name,
                     int ch)
              throws java.io.IOException,
                     org.xml.sax.SAXException
Parses a name.

Throws:
java.io.IOException
org.xml.sax.SAXException

finish

public void finish()
Finish reading.