argo.saj
Class SajParser

java.lang.Object
  extended by argo.saj.SajParser

public final class SajParser
extends java.lang.Object

Converts a character stream into calls to a JsonListener.

Instances of SajParser are threadsafe in that concurrent calls to parse are safe, provided each call is made with a different Reader and a different JsonListener.

See Also:
JsonListener

Constructor Summary
SajParser()
           
 
Method Summary
 void parse(java.io.Reader in, JsonListener jsonListener)
          Parses the given character stream into calls to the given JsonListener.
 void parse(java.lang.String json, JsonListener jsonListener)
          Parses the given JSON String into calls to the given JsonListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SajParser

public SajParser()
Method Detail

parse

public void parse(java.lang.String json,
                  JsonListener jsonListener)
           throws java.io.IOException,
                  InvalidSyntaxException
Parses the given JSON String into calls to the given JsonListener.

Parameters:
json - the String to parse.
jsonListener - the JsonListener to notify of parsing events
Throws:
java.io.IOException - bubbled up from exceptions thrown reading from in
InvalidSyntaxException - thrown to indicate the characters read from in did not constitute valid JSON.

parse

public void parse(java.io.Reader in,
                  JsonListener jsonListener)
           throws java.io.IOException,
                  InvalidSyntaxException
Parses the given character stream into calls to the given JsonListener.

Parameters:
in - the character stream to parse
jsonListener - the JsonListener to notify of parsing events
Throws:
java.io.IOException - bubbled up from exceptions thrown reading from in
InvalidSyntaxException - thrown to indicate the characters read from in did not constitute valid JSON.