org.basex.build.xml
Class XMLParser

java.lang.Object
  extended by org.basex.core.Progress
      extended by org.basex.build.Parser
          extended by org.basex.build.SingleParser
              extended by org.basex.build.xml.XMLParser
Direct Known Subclasses:
HTMLParser, JSONParser

public class XMLParser
extends SingleParser

This class parses the tokens that are delivered by the XMLScanner and sends them to the specified database builder. This class offers a more tolerant alternative to Java's internal SAX parser, which is used by the SAXWrapper class.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.build.Parser
src
 
Fields inherited from class org.basex.core.Progress
listen, updating
 
Constructor Summary
XMLParser(IO source, Prop pr)
          Constructor.
XMLParser(IO source, Prop pr, boolean frag)
          Constructor.
 
Method Summary
 void close()
          Closes the parser.
 void parse()
          Parses the current input.
 double prog()
          Returns a progress value (0 - 1).
 
Methods inherited from class org.basex.build.SingleParser
builder, parse
 
Methods inherited from class org.basex.build.Parser
emptyParser, info, item, singleParser, target, xmlParser
 
Methods inherited from class org.basex.core.Progress
checkStop, detail, listen, progress, startTimeout, stop, stopTimeout, title
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser(IO source,
                 Prop pr)
          throws java.io.IOException
Constructor.

Parameters:
source - document source
pr - database properties
Throws:
java.io.IOException - I/O exception

XMLParser

public XMLParser(IO source,
                 Prop pr,
                 boolean frag)
          throws java.io.IOException
Constructor.

Parameters:
source - document source
pr - database properties
frag - allow parsing of document fragment
Throws:
java.io.IOException - I/O exception
Method Detail

parse

public final void parse()
                 throws java.io.IOException
Description copied from class: SingleParser
Parses the current input.

Specified by:
parse in class SingleParser
Throws:
java.io.IOException - I/O exception

close

public void close()
           throws java.io.IOException
Description copied from class: Parser
Closes the parser.

Overrides:
close in class Parser
Throws:
java.io.IOException - I/O exception

prog

public final double prog()
Description copied from class: Progress
Returns a progress value (0 - 1). Can be overwritten to give more detailed information.

Returns:
header information