程序包 org.jsfr.json
类 SurfingContext
- java.lang.Object
-
- org.jsfr.json.SurfingContext
-
- 所有已实现的接口:
JsonSaxHandler,ParsingContext
public class SurfingContext extends Object implements ParsingContext, JsonSaxHandler
SurfingContext is not thread-safe
-
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 <T> Tcast(Object object, Class<T> tClass)booleanendArray()booleanendJSON()booleanendObject()SurfingConfigurationgetConfig()intgetCurrentArrayIndex()StringgetCurrentFieldName()StringgetJsonPath()booleanisPaused()booleanisStopped()<T> Tload(String key, Class<T> tClass)voidpause()Pause parsingbooleanprimitive(PrimitiveHolder primitiveHolder)voidresume()Resume parsingvoidsave(String key, Object value)Save a transient data during parsingbooleanshouldBreak()booleanstartArray()booleanstartJSON()booleanstartObject()booleanstartObjectEntry(String key)voidstop()Stop parsing
-
-
-
方法详细资料
-
startJSON
public boolean startJSON()
- 指定者:
startJSON在接口中JsonSaxHandler- 返回:
- Return false to stop the parsing immediately
-
endJSON
public boolean endJSON()
- 指定者:
endJSON在接口中JsonSaxHandler- 返回:
- Return false to stop the parsing immediately
-
startObject
public boolean startObject()
- 指定者:
startObject在接口中JsonSaxHandler- 返回:
- Return false to stop the parsing immediately
-
endObject
public boolean endObject()
- 指定者:
endObject在接口中JsonSaxHandler- 返回:
- Return false to stop the parsing immediately
-
startObjectEntry
public boolean startObjectEntry(String key)
- 指定者:
startObjectEntry在接口中JsonSaxHandler- 参数:
key- Entry key- 返回:
- Return false to stop the parsing immediately
-
startArray
public boolean startArray()
- 指定者:
startArray在接口中JsonSaxHandler- 返回:
- Return false to stop the parsing immediately
-
endArray
public boolean endArray()
- 指定者:
endArray在接口中JsonSaxHandler- 返回:
- Return false to stop the parsing immediately
-
primitive
public boolean primitive(PrimitiveHolder primitiveHolder)
- 指定者:
primitive在接口中JsonSaxHandler- 参数:
primitiveHolder- PrimitiveHolder- 返回:
- Return false to stop the parsing immediately
-
getJsonPath
public String getJsonPath()
- 指定者:
getJsonPath在接口中ParsingContext- 返回:
- The current JsonPath
-
getCurrentFieldName
public String getCurrentFieldName()
- 指定者:
getCurrentFieldName在接口中ParsingContext- 返回:
- The current field name. Null if current position is not in json object
-
getCurrentArrayIndex
public int getCurrentArrayIndex()
- 指定者:
getCurrentArrayIndex在接口中ParsingContext- 返回:
- The current index of json array. -1 if current position is not in json array
-
save
public void save(String key, Object value)
从接口复制的说明:ParsingContextSave a transient data during parsing- 指定者:
save在接口中ParsingContext- 参数:
key- keyvalue- value
-
load
public <T> T load(String key, Class<T> tClass)
- 指定者:
load在接口中ParsingContext- 类型参数:
T- type- 参数:
key- keytClass- class to cast- 返回:
- Saved value
-
cast
public <T> T cast(Object object, Class<T> tClass)
- 指定者:
cast在接口中ParsingContext- 类型参数:
T- type- 参数:
object- object to casttClass- type- 返回:
- casted object
-
shouldBreak
public boolean shouldBreak()
-
stop
public void stop()
从接口复制的说明:ParsingContextStop parsing- 指定者:
stop在接口中ParsingContext
-
isStopped
public boolean isStopped()
- 指定者:
isStopped在接口中ParsingContext- 返回:
- Whether parsing is stopped
-
pause
public void pause()
从接口复制的说明:ParsingContextPause parsing- 指定者:
pause在接口中ParsingContext
-
resume
public void resume()
从接口复制的说明:ParsingContextResume parsing- 指定者:
resume在接口中ParsingContext
-
isPaused
public boolean isPaused()
- 指定者:
isPaused在接口中ParsingContext- 返回:
- Whether parsing is paused
-
getConfig
public SurfingConfiguration getConfig()
-
-