org.basex.build.fs.parser
Class XMLParser

java.lang.Object
  extended by org.basex.build.fs.parser.AbstractParser
      extended by org.basex.build.fs.parser.XMLParser

public final class XMLParser
extends AbstractParser

Parser for XML files.

Author:
Workgroup DBIS, University of Konstanz 2005-09, ISC License, Bastian Lemke

Constructor Summary
XMLParser()
          Standard constructor.
 
Method Summary
 boolean check(BufferedFileChannel f)
           Checks if there is a File in correct format and can be read by the parser.
 void meta(BufferedFileChannel bfc, NewFSParser parser)
           Reads the metadata from a BufferedFileChannel and fires events for each key/value pair.
 void readContent(BufferedFileChannel f, NewFSParser parser)
           Reads the textual content from a FileChannel and fires events.
 
Methods inherited from class org.basex.build.fs.parser.AbstractParser
readMeta, readMetaAndContent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser()
Standard constructor.

Method Detail

check

public boolean check(BufferedFileChannel f)
Description copied from class: AbstractParser

Checks if there is a File in correct format and can be read by the parser. Checks e.g. header bytes.

Specified by:
check in class AbstractParser
Parameters:
f - the BufferedFileChannel to read from.
Returns:
true if the file is supported.

readContent

public void readContent(BufferedFileChannel f,
                        NewFSParser parser)
                 throws java.io.IOException
Description copied from class: AbstractParser

Reads the textual content from a FileChannel and fires events.

Specified by:
readContent in class AbstractParser
Parameters:
f - the BufferedFileChannel to read from.
parser - the NewFSParser instance to write the content to.
Throws:
java.io.IOException - if any error occurs while reading from the file.

meta

public void meta(BufferedFileChannel bfc,
                 NewFSParser parser)
Description copied from class: AbstractParser

Reads the metadata from a BufferedFileChannel and fires events for each key/value pair.

Parameters:
bfc - BufferedFileChannel to read from.
parser - the NewFSParser instance to fire events.
See Also:
NewFSParser.metaEvent(Metadata)