org.basex.query.util.json
Class JsonParser

java.lang.Object
  extended by org.basex.util.InputParser
      extended by org.basex.query.util.json.JsonParser

public final class JsonParser
extends InputParser

A JSON parser generating parse events similar to a SAX XML parser.

Author:
BaseX Team 2005-12, BSD License, Leo Woerteler

Nested Class Summary
static class JsonParser.Spec
          JSON specs.
 
Field Summary
 
Fields inherited from class org.basex.util.InputParser
file, input, length, mark, pos
 
Method Summary
static void parse(java.lang.String json, JsonParser.Spec sp, boolean unesc, JsonHandler h, InputInfo ii)
          Parses the input JSON string and directs the parse events to the given handler.
 
Methods inherited from class org.basex.util.InputParser
consume, consume, consume, curr, curr, file, found, info, mark, more, next, quote, rest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parse

public static void parse(java.lang.String json,
                         JsonParser.Spec sp,
                         boolean unesc,
                         JsonHandler h,
                         InputInfo ii)
                  throws QueryException
Parses the input JSON string and directs the parse events to the given handler.

Parameters:
json - JSON string to parse
sp - JSON spec to use
unesc - unescape flag
h - JSON handler
ii - input info
Throws:
QueryException - parse exception