org.json.simple.parser
类 JSONParser

java.lang.Object
  继承者 org.json.simple.parser.JSONParser

public class JSONParser
extends java.lang.Object

Parser for JSON text. Please note that JSONParser is NOT thread-safe.

作者:
FangYidong

字段摘要
static int S_END
           
static int S_IN_ARRAY
           
static int S_IN_ERROR
           
static int S_IN_FINISHED_VALUE
           
static int S_IN_OBJECT
           
static int S_IN_PAIR_VALUE
           
static int S_INIT
           
static int S_PASSED_PAIR_KEY
           
 
构造方法摘要
JSONParser()
           
 
方法摘要
 int getPosition()
           
 java.lang.Object parse(java.io.Reader in)
           
 java.lang.Object parse(java.io.Reader in, ContainerFactory containerFactory)
          Parse JSON text into java object from the input source.
 void parse(java.io.Reader in, ContentHandler contentHandler)
           
 void parse(java.io.Reader in, ContentHandler contentHandler, boolean isResume)
          Stream processing of JSON text.
 java.lang.Object parse(java.lang.String s)
           
 java.lang.Object parse(java.lang.String s, ContainerFactory containerFactory)
           
 void parse(java.lang.String s, ContentHandler contentHandler)
           
 void parse(java.lang.String s, ContentHandler contentHandler, boolean isResume)
           
 void reset()
          Reset the parser to the initial state without resetting the underlying reader.
 void reset(java.io.Reader in)
          Reset the parser to the initial state with a new character reader.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

S_INIT

public static final int S_INIT
另请参见:
常量字段值

S_IN_FINISHED_VALUE

public static final int S_IN_FINISHED_VALUE
另请参见:
常量字段值

S_IN_OBJECT

public static final int S_IN_OBJECT
另请参见:
常量字段值

S_IN_ARRAY

public static final int S_IN_ARRAY
另请参见:
常量字段值

S_PASSED_PAIR_KEY

public static final int S_PASSED_PAIR_KEY
另请参见:
常量字段值

S_IN_PAIR_VALUE

public static final int S_IN_PAIR_VALUE
另请参见:
常量字段值

S_END

public static final int S_END
另请参见:
常量字段值

S_IN_ERROR

public static final int S_IN_ERROR
另请参见:
常量字段值
构造方法详细信息

JSONParser

public JSONParser()
方法详细信息

reset

public void reset()
Reset the parser to the initial state without resetting the underlying reader.


reset

public void reset(java.io.Reader in)
Reset the parser to the initial state with a new character reader.

参数:
in - - The new character reader.
抛出:
java.io.IOException
ParseException

getPosition

public int getPosition()
返回:
The position of the beginning of the current token.

parse

public java.lang.Object parse(java.lang.String s)
                       throws ParseException
抛出:
ParseException

parse

public java.lang.Object parse(java.lang.String s,
                              ContainerFactory containerFactory)
                       throws ParseException
抛出:
ParseException

parse

public java.lang.Object parse(java.io.Reader in)
                       throws java.io.IOException,
                              ParseException
抛出:
java.io.IOException
ParseException

parse

public java.lang.Object parse(java.io.Reader in,
                              ContainerFactory containerFactory)
                       throws java.io.IOException,
                              ParseException
Parse JSON text into java object from the input source.

参数:
in -
containerFactory - - Use this factory to createyour own JSON object and JSON array containers.
返回:
Instance of the following: org.json.simple.JSONObject, org.json.simple.JSONArray, java.lang.String, java.lang.Number, java.lang.Boolean, null
抛出:
java.io.IOException
ParseException

parse

public void parse(java.lang.String s,
                  ContentHandler contentHandler)
           throws ParseException
抛出:
ParseException

parse

public void parse(java.lang.String s,
                  ContentHandler contentHandler,
                  boolean isResume)
           throws ParseException
抛出:
ParseException

parse

public void parse(java.io.Reader in,
                  ContentHandler contentHandler)
           throws java.io.IOException,
                  ParseException
抛出:
java.io.IOException
ParseException

parse

public void parse(java.io.Reader in,
                  ContentHandler contentHandler,
                  boolean isResume)
           throws java.io.IOException,
                  ParseException
Stream processing of JSON text.

参数:
in -
contentHandler -
isResume - - Indicates if it continues previous parsing operation. If set to true, resume parsing the old stream, and parameter 'in' will be ignored. If this method is called for the first time in this instance, isResume will be ignored.
抛出:
java.io.IOException
ParseException
另请参见:
ContentHandler


Copyright © 2012. All Rights Reserved.