ref_send API 2.17
defensive programming in Java

org.waterken.syntax.json
Class JSONParser

java.lang.Object
  extended by org.waterken.syntax.json.JSONParser

public final class JSONParser
extends java.lang.Object

Deserializes a JSON text stream.


Constructor Summary
JSONParser(java.lang.String base, Importer connect, java.lang.ClassLoader code, java.io.Reader text)
          Constructs an instance.
 
Method Summary
 ConstArray<?> readTuple(java.lang.reflect.Type... parameters)
          Deserializes an array of objects.
 java.lang.Object readValue(java.lang.reflect.Type type)
          Deserializes an object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONParser

public JSONParser(java.lang.String base,
                  Importer connect,
                  java.lang.ClassLoader code,
                  java.io.Reader text)
Constructs an instance.

Parameters:
base - base URL
connect - reference importer
code - class loader
text - UTF-8 JSON text stream
Method Detail

readTuple

public ConstArray<?> readTuple(java.lang.reflect.Type... parameters)
                        throws java.io.IOException,
                               BadSyntax
Deserializes an array of objects.

Parameters:
parameters - each expected type
Returns:
parsed argument list
Throws:
java.io.IOException - any I/O error
BadSyntax - invalid JSON text

readValue

public java.lang.Object readValue(java.lang.reflect.Type type)
                           throws java.io.IOException,
                                  BadSyntax
Deserializes an object.

Parameters:
type - expected type
Returns:
parsed object
Throws:
java.io.IOException - any I/O error
BadSyntax - invalid JSON text

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.