org.basex.build.file
Class JSONParser

java.lang.Object
  extended by org.basex.core.Proc
      extended by org.basex.build.Parser
          extended by org.basex.build.SingleParser
              extended by org.basex.build.xml.XMLParser
                  extended by org.basex.build.file.JSONParser

public final class JSONParser
extends XMLParser

This class parses files in the JSON format and sends events to the specified database builder.

The parser provides some options, which can be specified via SET PARSEROPT ...:

All options are separated by commas, and the keys and values are separated by equality sign (=).

Example: SET PARSEROPT separator=tab,format=simple,header=no; CREATE DB ...
Description: Use tabs as separator, choose simple XML format, and indicate that the file contains no header.

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

Field Summary
 
Fields inherited from class org.basex.build.SingleParser
builder
 
Fields inherited from class org.basex.build.Parser
atts, nsp, prop, src
 
Fields inherited from class org.basex.core.Proc
listen, updating
 
Constructor Summary
JSONParser(IO source, Prop pr)
          Constructor.
JSONParser(IO source, Prop pr, java.lang.String options)
          Constructor.
 
Method Summary
 
Methods inherited from class org.basex.build.xml.XMLParser
close, det, parse, prog
 
Methods inherited from class org.basex.build.SingleParser
builder, parse
 
Methods inherited from class org.basex.build.Parser
emptyParser, info, singleParser, target, xmlParser
 
Methods inherited from class org.basex.core.Proc
abort, checkStop, databases, detail, listen, proc, progress, registered, registered, startTimeout, stop, stopTimeout, tit, title
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONParser

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

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

JSONParser

public JSONParser(IO source,
                  Prop pr,
                  java.lang.String options)
           throws java.io.IOException
Constructor.

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