org.apache.xml.resolver.readers
Class TextCatalogReader
- CatalogReader
public class TextCatalogReader
Parses plain text Catalog files.
This class reads plain text Open Catalog files.
protected boolean | caseSensitive - Are keywords in the catalog case sensitive?
|
protected InputStream | catfile - The input stream used to read the catalog
|
protected int[] | stack - Character lookahead stack.
|
protected Stack | tokenStack - Token stack.
|
protected int | top - The current position on the lookahead stack
|
caseSensitive
protected boolean caseSensitive
Are keywords in the catalog case sensitive?
catfile
protected InputStream catfile
The input stream used to read the catalog
stack
protected int[] stack
Character lookahead stack. Reading a catalog sometimes requires
up to two characters of lookahead.
tokenStack
protected Stack tokenStack
Token stack. Recognizing an unexpected catalog entry requires
the ability to "push back" a token.
top
protected int top
The current position on the lookahead stack
TextCatalogReader
public TextCatalogReader()
Construct a CatalogReader object.
finalize
protected void finalize()
The destructor.
Makes sure the catalog file is closed.
getCaseSensitive
public boolean getCaseSensitive()
nextChar
protected int nextChar()
throws IOException
Return the next logical character from the input stream.
- The next (logical) character from the input stream. The
character may be buffered from a previous lookahead.
nextToken
protected String nextToken()
throws IOException,
CatalogException
Return the next token in the catalog file.
FYI: This code does not throw any sort of exception for
a file that contains an n
- The Catalog file token from the input stream.
readCatalog
public void readCatalog(Catalog catalog,
InputStream is)
throws MalformedURLException,
IOException
Read a catalog from an input stream.
This class reads a catalog from an input stream.
- readCatalog in interface CatalogReader
catalog
- The catalog for which this reader is called.is
- The input stream that is to be read.
readCatalog
public void readCatalog(Catalog catalog,
String fileUrl)
throws MalformedURLException,
IOException
Start parsing a text catalog file. The file is
actually read and parsed
as needed by nextEntry
.
- readCatalog in interface CatalogReader
fileUrl
- The URL or filename of the catalog file to process
setCaseSensitive
public void setCaseSensitive(boolean isCaseSensitive)
Copyright B) 2001-2003 Apache Software Foundation. All Rights Reserved.