public class TextCatalogReader extends Object implements CatalogReader
This class reads plain text Open Catalog files.
Catalog| Modifier and Type | Field and Description |
|---|---|
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
|
| Constructor and Description |
|---|
TextCatalogReader()
Construct a CatalogReader object.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
finalize()
The destructor.
|
boolean |
getCaseSensitive() |
protected int |
nextChar()
Return the next logical character from the input stream.
|
protected String |
nextToken()
Return the next token in the catalog file.
|
void |
readCatalog(Catalog catalog,
InputStream is)
Read a catalog from an input stream.
|
void |
readCatalog(Catalog catalog,
String fileUrl)
Start parsing a text catalog file.
|
void |
setCaseSensitive(boolean isCaseSensitive) |
protected InputStream catfile
protected int[] stack
protected Stack tokenStack
protected int top
protected boolean caseSensitive
public void setCaseSensitive(boolean isCaseSensitive)
public boolean getCaseSensitive()
public void readCatalog(Catalog catalog, String fileUrl) throws MalformedURLException, IOException
nextEntry.readCatalog in interface CatalogReaderfileUrl - The URL or filename of the catalog file to processcatalog - The catalog for which this reader is called.MalformedURLException - Improper fileUrlIOException - Error reading catalog filepublic void readCatalog(Catalog catalog, InputStream is) throws MalformedURLException, 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.IOException - if the URL cannot be read.MalformedURLExceptionprotected void finalize()
Makes sure the catalog file is closed.
protected String nextToken() throws IOException, CatalogException
FYI: This code does not throw any sort of exception for a file that contains an n
IOException - If an error occurs reading from the stream.CatalogExceptionprotected int nextChar()
throws IOException
IOException - If an error occurs reading from the stream.Copyright © 2005–2017 Oracle Corporation. All rights reserved.