cc.plural.jsonij
Class JSONParser

java.lang.Object
  extended by cc.plural.jsonij.JSONParser

public class JSONParser
extends Object

Author:
J.W.Marsden

Nested Class Summary
static class JSONParser.StatefullValue
           
 
Field Summary
protected  Locale locale
           
 
Constructor Summary
JSONParser()
           
 
Method Summary
 Locale getLocale()
           
 Value parse(Reader targetReader)
           
 Value parse(String targetString)
           
 JSON.Array<Value> parseArray(JSONReader target)
          Parses a JSON Array Value from the reader.
 JSON.False parseFalse(JSONReader target)
          Parses a JSON False Value from the reader.
 JSON.Null parseNull(JSONReader target)
          Parses a JSON Null Value from the reader.
 JSON.Numeric parseNumeric(JSONReader target)
          Parses a JSON Numeric Value from the reader.
 JSON.Object<JSON.String,Value> parseObject(JSONReader target)
          Parses a JSON Object Value from the reader.
 JSONParser.StatefullValue parseStatefullValue(String targetString, int startIndex)
           
 JSON.String parseString(JSONReader target)
          Parses a JSON String Value from the reader.
 JSON.True parseTrue(JSONReader target)
          Parses a JSON True Value from the reader.
 Value parseValue(JSONReader target)
          Parse a JSON Value from the target.
 Value parseValue(String targetString)
           
 Locale setLocale(Locale locale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locale

protected Locale locale
Constructor Detail

JSONParser

public JSONParser()
Method Detail

getLocale

public final Locale getLocale()
Returns:
the locale

setLocale

public final Locale setLocale(Locale locale)
Parameters:
locale - the locale to set

parse

public final Value parse(String targetString)
                  throws IOException,
                         ParserException
Throws:
IOException
ParserException

parse

public final Value parse(Reader targetReader)
                  throws IOException,
                         ParserException
Throws:
IOException
ParserException

parseValue

public final Value parseValue(String targetString)
                       throws IOException,
                              ParserException
Throws:
IOException
ParserException

parseStatefullValue

public final JSONParser.StatefullValue parseStatefullValue(String targetString,
                                                           int startIndex)
                                                    throws IOException,
                                                           ParserException
Throws:
IOException
ParserException

parseValue

public final Value parseValue(JSONReader target)
                       throws IOException,
                              ParserException
Parse a JSON Value from the target.

Parameters:
target - Reader to read from.
Returns:
The JSON Value instance just parsed(getMessages().getString("invalidValue")
Throws:
IOException - IO Exception
ParserException - JSON Parser Exception

parseObject

public final JSON.Object<JSON.String,Value> parseObject(JSONReader target)
                                                 throws IOException,
                                                        ParserException
Parses a JSON Object Value from the reader.

Parameters:
target - The reader to read the value from
Returns:
The Object Value
Throws:
IOException - IO Exception
ParserException - JSON Parser Exception

parseArray

public final JSON.Array<Value> parseArray(JSONReader target)
                                   throws IOException,
                                          ParserException
Parses a JSON Array Value from the reader.

Parameters:
target - The reader to read the value from
Returns:
The Array Value
Throws:
IOException - IO Exception
ParserException - JSON Parser Exception

parseString

public final JSON.String parseString(JSONReader target)
                              throws IOException,
                                     ParserException
Parses a JSON String Value from the reader.

Parameters:
target - The reader to read the value from
Returns:
The String Value
Throws:
IOException - IO Exception
ParserException - JSON Parser Exception

parseNumeric

public final JSON.Numeric parseNumeric(JSONReader target)
                                throws IOException,
                                       ParserException
Parses a JSON Numeric Value from the reader.

Parameters:
target - The reader to read the value from
Returns:
The Value of the numeric
Throws:
IOException - IO Exception
ParserException - JSON Parser Exception

parseTrue

public final JSON.True parseTrue(JSONReader target)
                          throws IOException,
                                 ParserException
Parses a JSON True Value from the reader.

Parameters:
target - The reader to read the value from
Returns:
The False Value
Throws:
IOException - IO Exception
ParserException - JSON Parser Exception

parseFalse

public final JSON.False parseFalse(JSONReader target)
                            throws IOException,
                                   ParserException
Parses a JSON False Value from the reader.

Parameters:
target - The reader to read the value from
Returns:
The False Value
Throws:
IOException - IO Exception
ParserException - JSON Parser Exception

parseNull

public final JSON.Null parseNull(JSONReader target)
                          throws IOException,
                                 ParserException
Parses a JSON Null Value from the reader.

Parameters:
target - The reader to read the value from
Returns:
The Null Value
Throws:
IOException - IO Exception
ParserException - JSON Parser Exception


Copyright © 2012. All Rights Reserved.