|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SourceCatalogReader
A reader that creates source catalogs from text.
CVS Info:
$Revision: 1273 $ |
$Date: 2008-05-07 13:46:38 -0600 (Wed, 07 May 2008) $ |
$Author: jrochfor $ |
Method Summary | |
---|---|
SourceCatalog |
getCatalog()
Returns the catalog most recently created by this reader. |
String |
getError(int index)
Returns the index th error found during the most
recent read. |
int |
getErrorCount()
Returns the number of errors found during the most recent read. |
StringBuilder |
getErrors()
Returns the combined text of all errors found during the most recent read. |
boolean |
getSuccess()
Returns true if the most recently read data caused no parsing errors. |
boolean |
read(InputStream in)
Reads data from in and uses it to add sources to
a SourceCatalog . |
boolean |
read(InputStream in,
FileCompressionFormat format)
Reads data from in and uses it to add sources to a SourceCatalog . |
boolean |
read(InputStream in,
SourceCatalog destination)
Reads data from in and uses it to add sources to
destination . |
boolean |
read(InputStream in,
SourceCatalog destination,
FileCompressionFormat format)
Reads data from in and uses it to add sources to destination . |
boolean |
read(Reader in)
Reads data from in and uses it to add sources to
a SourceCatalog . |
boolean |
read(Reader in,
SourceCatalog destination)
Reads data from in and uses it to add sources to
destination . |
boolean |
read(String fileName)
Reads data from a file and uses it to add sources to a SourceCatalog . |
boolean |
read(String fileName,
SourceCatalog destination)
Reads data from a file and uses it to add sources to destination . |
void |
setOriginOfSourceInformation(String origin)
Sets text that will be used as the source of information for each source read by this reader. |
void |
setPrefixForHistoricalRecords(String prefix)
Sets text that will be used as a prefix for any historical source records generated by this reader. |
Method Detail |
---|
boolean read(String fileName) throws FileNotFoundException
SourceCatalog
.
fileName
- the name of a data file.
FileNotFoundException
- if the data file could not be found.read(Reader, SourceCatalog)
boolean read(String fileName, SourceCatalog destination) throws FileNotFoundException
destination
.
fileName
- the name of a data file.destination
- the catalog to which the sources should be
added. If this parameter is null,
a new catalog will be created.
FileNotFoundException
- if the data file could not be found.read(Reader, SourceCatalog)
boolean read(Reader in)
in
and uses it to add sources to
a SourceCatalog
.
in
- the source of text that can be read and turned into
Source
objects.
read(Reader, SourceCatalog)
boolean read(Reader in, SourceCatalog destination)
in
and uses it to add sources to
destination
.
in
- the source of text that can be read and turned into
Source
objects.destination
- the catalog to which the sources should be
added. If this parameter is null,
a new catalog will be created.
getCatalog()
,
getErrors()
boolean read(InputStream in)
in
and uses it to add sources to
a SourceCatalog
.
in
- the source of text that can be read and turned into
Source
objects.
read(InputStream, SourceCatalog)
boolean read(InputStream in, SourceCatalog destination)
in
and uses it to add sources to
destination
.
in
- the source of text that can be read and turned into
Source
objects.destination
- the catalog to which the sources should be
added. If this parameter is null,
a new catalog will be created.
getCatalog()
,
getErrors()
boolean read(InputStream in, FileCompressionFormat format)
in
and uses it to add sources to a SourceCatalog
. If format
is specified and non-null, the
InputStream should be uncompressed if necessary before being used as a
source for Source information.
in
- the source of text that can be read and turned into
Source
objects.
getCatalog()
,
getErrors()
boolean read(InputStream in, SourceCatalog destination, FileCompressionFormat format)
in
and uses it to add sources to destination
. If format
is specified and non-null, the
InputStream should be uncompressed if necessary before being used as a
source for Source information.
in
- the source of text that can be read and turned into
Source
objects.destination
- the catalog to which the sources should be
added. If this parameter is null,
a new catalog will be created.
getCatalog()
,
getErrors()
SourceCatalog getCatalog()
If this reader had trouble parsing the catalog data, the returned catalog may be partially or completely unfilled. If the read method has never been called, a new catalog will be returned.
boolean getSuccess()
SourceCatalog
created
by this reader may be perfectly fine even if this method
returns false.
StringBuilder getErrors()
Note that an "error" is anything unexpected encountered while reading. Not all errors are harmful. The text of each error includes the line number where it occurred and an explanation of what was wrong.
String getError(int index)
index
th error found during the most
recent read.
index
- a positional value >= zero and < getErrorCount()
.
index
th error found during the most
recent read.getErrors()
int getErrorCount()
getErrors()
void setOriginOfSourceInformation(String origin)
origin
- text that will be used as the source of information for each
source read by this reader. A value of null will be
interpreted as a single not to set the source's origin of
information.void setPrefixForHistoricalRecords(String prefix)
prefix
- text that will be used as a prefix for any historical source
records generated by this reader.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |