org.deepfs.fsml.parsers
Class XMLParser

java.lang.Object
  extended by org.deepfs.fsml.parsers.XMLParser
All Implemented Interfaces:
IFileParser

public final class XMLParser
extends Object
implements IFileParser

Parser for XML files.

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

Constructor Summary
XMLParser()
           
 
Method Summary
 boolean check(DeepFile df)
           Checks if there is a File in correct format and can be read by the parser.
 void extract(DeepFile deepFile)
          Extracts metadata and file contents.
 Data parse(BufferedFileChannel f, Prop prop)
          Checks if the document is well-formed and returns the corresponding main memory database.
 void propagate(DeepFile deepFile)
          Propagates the metadata and file contents back to the file in the file system.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser()
Method Detail

check

public boolean check(DeepFile df)
              throws IOException
Description copied from interface: IFileParser

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 interface IFileParser
Parameters:
df - the DeepFile to read from
Returns:
true if the file is supported
Throws:
IOException - if an error occurs while reading from the file

parse

public Data parse(BufferedFileChannel f,
                  Prop prop)
           throws IOException
Checks if the document is well-formed and returns the corresponding main memory database.

Parameters:
f - the BufferedFileChannel to read the xml document from
prop - the database properties to use
Returns:
the main memory database or null if the document is not well-formed
Throws:
IOException - if any error occurs

extract

public void extract(DeepFile deepFile)
             throws IOException
Description copied from interface: IFileParser
Extracts metadata and file contents.

Specified by:
extract in interface IFileParser
Parameters:
deepFile - the DeepFile to save metadata and content to
Throws:
IOException - if any error occurs while reading from the file

propagate

public void propagate(DeepFile deepFile)
Description copied from interface: IFileParser
Propagates the metadata and file contents back to the file in the file system.

Specified by:
propagate in interface IFileParser
Parameters:
deepFile - the DeepFile that contains the metadata and file contents