org.basex.build
Class Parser

java.lang.Object
  extended by org.basex.build.Parser
Direct Known Subclasses:
DirParser, DOCWrapper, FSParser, MAB2Parser, SAXWrapper, XMLParser

public abstract class Parser
extends java.lang.Object

This class defines a parser for creating databases from various sources.

Author:
Workgroup DBIS, University of Konstanz 2005-09, ISC License, Christian Gruen

Field Summary
 boolean doc
          Document flag; if true, a document node is added.
 IO io
          Input file.
 
Method Summary
 java.lang.String det()
          Returns detailed progress information.
static Parser getXMLParser(IO io)
          Returns an XML parser instance.
 java.lang.String head()
          Returns a compact description of the current progress.
abstract  void parse(Builder build)
          Parses all nodes and sends events to the specified builder.
 double prog()
          Returns a value from 0 to 1, representing the current progress.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doc

public boolean doc
Document flag; if true, a document node is added.


io

public IO io
Input file.

Method Detail

getXMLParser

public static Parser getXMLParser(IO io)
                           throws java.io.IOException
Returns an XML parser instance.

Parameters:
io - io reference
Returns:
xml parser
Throws:
java.io.IOException - io exception

parse

public abstract void parse(Builder build)
                    throws java.io.IOException
Parses all nodes and sends events to the specified builder.

Parameters:
build - event listener.
Throws:
java.io.IOException - I/O exception

head

public java.lang.String head()
Returns a compact description of the current progress.

Returns:
progress information

det

public java.lang.String det()
Returns detailed progress information.

Returns:
position info

prog

public double prog()
Returns a value from 0 to 1, representing the current progress.

Returns:
progress information