|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.basex.build.fs.parser.AbstractParser
public abstract class AbstractParser
Abstract class for metadata extractors / file parsers.
| Method Summary | |
|---|---|
abstract boolean |
check(BufferedFileChannel bfc)
Checks if there is a File in correct format and can be read by the parser. |
abstract void |
readContent(BufferedFileChannel bfc,
NewFSParser parser)
Reads the textual content from a FileChannel and fires events. |
void |
readMeta(BufferedFileChannel bfc,
NewFSParser parser)
Reads the metadata from a BufferedFileChannel and fires events for
each key/value pair. |
void |
readMetaAndContent(BufferedFileChannel bfc,
NewFSParser parser)
Reads metadata and content from a BufferedFileChannel and fires
events for each key-value pair. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public abstract boolean check(BufferedFileChannel bfc)
throws java.io.IOException
Checks if there is a File in correct format and can be read by the parser. Checks e.g. header bytes.
bfc - the BufferedFileChannel to read from.
java.io.IOException - if an error occurs while reading from the file.
public void readMeta(BufferedFileChannel bfc,
NewFSParser parser)
throws java.io.IOException
Reads the metadata from a BufferedFileChannel and fires events for
each key/value pair.
bfc - BufferedFileChannel to read from.parser - the NewFSParser instance to fire events.
java.io.IOException - if any error occurs while reading from the file.NewFSParser.metaEvent(Metadata)
public void readMetaAndContent(BufferedFileChannel bfc,
NewFSParser parser)
throws java.io.IOException
Reads metadata and content from a BufferedFileChannel and fires
events for each key-value pair.
Does the same as the two method calls:
but is potentially much more efficient (depends on the actual parser implementation).readMeta(BufferedFileChannel, NewFSParser);readContent(BufferedFileChannel, NewFSParser);
The order of the fired elements may differ from the two separate method calls.
bfc - the BufferedFileChannel to read from.parser - the NewFSParser instance to write the content to.
java.io.IOException - if any error occurs while reading from the file.
public abstract void readContent(BufferedFileChannel bfc,
NewFSParser parser)
throws java.io.IOException
Reads the textual content from a FileChannel and fires events.
bfc - the BufferedFileChannel to read from.parser - the NewFSParser instance to write the content to.
java.io.IOException - if any error occurs while reading from the file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||