CatalogReaderTR9401CatalogReaderpublic class TextCatalogReader extends java.lang.Object implements CatalogReader
This class reads plain text Open Catalog files.
Catalog| Modifier and Type | Field | Description |
|---|---|---|
protected boolean |
caseSensitive |
Are keywords in the catalog case sensitive?
|
protected java.io.InputStream |
catfile |
The input stream used to read the catalog
|
protected int[] |
stack |
Character lookahead stack.
|
protected java.util.Stack |
tokenStack |
Token stack.
|
protected int |
top |
The current position on the lookahead stack
|
| Constructor | Description |
|---|---|
TextCatalogReader() |
Construct a CatalogReader object.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
finalize() |
The destructor.
|
boolean |
getCaseSensitive() |
|
protected int |
nextChar() |
Return the next logical character from the input stream.
|
protected java.lang.String |
nextToken() |
Return the next token in the catalog file.
|
void |
readCatalog(Catalog catalog,
java.io.InputStream is) |
Read a catalog from an input stream.
|
void |
readCatalog(Catalog catalog,
java.lang.String fileUrl) |
Start parsing a text catalog file.
|
void |
setCaseSensitive(boolean isCaseSensitive) |
protected java.io.InputStream catfile
protected int[] stack
protected java.util.Stack tokenStack
protected int top
protected boolean caseSensitive
public void setCaseSensitive(boolean isCaseSensitive)
public boolean getCaseSensitive()
public void readCatalog(Catalog catalog, java.lang.String fileUrl) throws java.net.MalformedURLException, java.io.IOException
nextEntry.readCatalog in interface CatalogReaderfileUrl - The URL or filename of the catalog file to processcatalog - The catalog for which this reader is called.java.net.MalformedURLException - Improper fileUrljava.io.IOException - Error reading catalog filepublic void readCatalog(Catalog catalog, java.io.InputStream is) throws java.net.MalformedURLException, java.io.IOException
CatalogReaderThis class reads a catalog from an input stream.
readCatalog in interface CatalogReadercatalog - The catalog for which this reader is called.is - The input stream that is to be read.java.io.IOException - if the URL cannot be read.java.net.MalformedURLExceptionprotected void finalize()
Makes sure the catalog file is closed.
finalize in class java.lang.Objectprotected java.lang.String nextToken()
throws java.io.IOException,
CatalogException
FYI: This code does not throw any sort of exception for a file that contains an n
java.io.IOException - If an error occurs reading from the stream.CatalogExceptionprotected int nextChar()
throws java.io.IOException
java.io.IOException - If an error occurs reading from the stream.Copyright ? 2001-2003 Apache Software Foundation. All Rights Reserved.