程序包 org.jsfr.json
类 JsonSurfer
- java.lang.Object
-
- org.jsfr.json.JsonSurfer
-
public class JsonSurfer extends Object
JsonSurfer traverses the whole json DOM tree, compare the path of each node with registered JsonPath and return the matched value immediately. JsonSurfer is fully streaming which means that it doesn't construct the DOM tree in memory.
-
-
构造器概要
构造器 构造器 说明 JsonSurfer(JsonParserAdapter jsonParserAdapter, JsonProvider jsonProvider)JsonSurfer(JsonParserAdapter jsonParserAdapter, JsonProvider jsonProvider, ErrorHandlingStrategy errorHandlingStrategy)
-
方法概要
-
-
-
构造器详细资料
-
JsonSurfer
public JsonSurfer(JsonParserAdapter jsonParserAdapter, JsonProvider jsonProvider)
- 参数:
jsonParserAdapter- jsonParserAdapterjsonProvider- jsonProvider
-
JsonSurfer
public JsonSurfer(JsonParserAdapter jsonParserAdapter, JsonProvider jsonProvider, ErrorHandlingStrategy errorHandlingStrategy)
- 参数:
jsonParserAdapter- jsonParserAdapterjsonProvider- jsonProvidererrorHandlingStrategy- errorHandlingStrategy
-
-
方法详细资料
-
configBuilder
public SurfingConfiguration.Builder configBuilder()
Create SurfingConfiguration builder associated with this surfer- 返回:
- SurfingConfiguration builder
-
iterator
@Deprecated public Iterator<Object> iterator(Reader reader, JsonPath jsonPath)
已过时。Useiterator(InputStream, JsonPath)instead.Create a streaming iterator which can pull matched value one by one according to provided JsonPath. Internally, only one matched value stored in memory- 参数:
reader- Json sourcejsonPath- JsonPath- 返回:
- Streaming iterator
-
iterator
public Iterator<Object> iterator(InputStream inputStream, JsonPath jsonPath)
Create a streaming iterator which can pull matched value one by one according to provided JsonPath. Internally, only one matched value stored in memory- 参数:
inputStream- Json sourcejsonPath- JsonPath- 返回:
- Streaming iterator
-
iterator
public Iterator<Object> iterator(String json, JsonPath jsonPath)
Create a streaming iterator which can pull matched value one by one according to provided JsonPath. Internally, only one matched value stored in memory- 参数:
json- Json sourcejsonPath- JsonPath- 返回:
- Streaming iterator
-
surf
public void surf(String json, SurfingConfiguration configuration)
Start surfing- 参数:
json- jsonconfiguration- SurfingConfiguration that holds JsonPath binding
-
surf
@Deprecated public void surf(Reader json, SurfingConfiguration configuration)
已过时。usesurf(InputStream, SurfingConfiguration)insteadStart surfing- 参数:
json- Json sourceconfiguration- SurfingConfiguration that holds JsonPath binding
-
surf
public void surf(InputStream json, SurfingConfiguration configuration)
- 参数:
json- Json InputStreamconfiguration- SurfingConfiguration that holds JsonPath binding
-
createResumableParser
public ResumableParser createResumableParser(String json, SurfingConfiguration configuration)
Create resumable parser- 参数:
json- Json sourceconfiguration- SurfingConfiguration- 返回:
- Resumable parser
-
createResumableParser
@Deprecated public ResumableParser createResumableParser(Reader json, SurfingConfiguration configuration)
已过时。Create resumable parser- 参数:
json- Json sourceconfiguration- SurfingConfiguration- 返回:
- Resumable parser
-
createResumableParser
public ResumableParser createResumableParser(InputStream json, SurfingConfiguration configuration)
Create resumable parser- 参数:
json- Json sourceconfiguration- SurfingConfiguration- 返回:
- Resumable parser
-
createNonBlockingParser
public NonBlockingParser createNonBlockingParser(SurfingConfiguration configuration)
Create non-blocking parser- 参数:
configuration-- 返回:
-
collector
public Collector collector(String json)
Create collector object- 参数:
json- Json string- 返回:
- collector
-
collector
public Collector collector(InputStream json)
Create collector object- 参数:
json- Json InputStream- 返回:
- collector
-
collectAll
@Deprecated public Collection<Object> collectAll(String json, String... paths)
已过时。usecollector(String)insteadCollect all matched value into a collection- 参数:
json- Json stringpaths- JsonPath- 返回:
- collection
-
collectAll
@Deprecated public Collection<Object> collectAll(String json, JsonPath... paths)
已过时。usecollector(String)insteadCollect all matched value into a collection- 参数:
json- Json stringpaths- JsonPath- 返回:
- collection
-
collectAll
@Deprecated public <T> Collection<T> collectAll(String json, Class<T> tClass, JsonPath... paths)
已过时。usecollector(String)instead- 类型参数:
T- target class- 参数:
json- jsontClass- target classpaths- JsonPath- 返回:
- typed value
-
collectAll
@Deprecated public Collection<Object> collectAll(Reader reader, String... paths)
已过时。usecollector(String)insteadCollect all matched value into a collection- 参数:
reader- Json readerpaths- JsonPath- 返回:
- values
-
collectAll
@Deprecated public Collection<Object> collectAll(Reader reader, JsonPath... paths)
已过时。usecollector(String)insteadCollect all matched value into a collection- 参数:
reader- Json readerpaths- JsonPath- 返回:
- All matched value
-
collectAll
@Deprecated public <T> Collection<T> collectAll(Reader reader, Class<T> tClass, JsonPath... paths)
已过时。usecollector(String)insteadCollect all matched value into a collection- 类型参数:
T- type- 参数:
reader- Json readertClass- typepaths- JsonPath- 返回:
- typed value
-
collectAll
@Deprecated public Collection<Object> collectAll(InputStream inputStream, String... paths)
已过时。usecollector(InputStream)insteadCollect all matched value into a collection- 参数:
inputStream- Json readerpaths- JsonPath- 返回:
- values
-
collectAll
@Deprecated public Collection<Object> collectAll(InputStream inputStream, JsonPath... paths)
已过时。usecollector(InputStream)insteadCollect all matched value into a collection- 参数:
inputStream- Json readerpaths- JsonPath- 返回:
- All matched value
-
collectAll
@Deprecated public <T> Collection<T> collectAll(InputStream inputStream, Class<T> tClass, JsonPath... paths)
已过时。usecollector(InputStream)insteadCollect all matched value into a collection- 类型参数:
T- type- 参数:
inputStream- Json readertClass- typepaths- JsonPath- 返回:
- typed value
-
collectOne
@Deprecated public Object collectOne(String json, String... paths)
已过时。usecollector(String)insteadCollect the first matched value and stop parsing immediately- 参数:
json- jsonpaths- JsonPath- 返回:
- value
-
collectOne
@Deprecated public Object collectOne(String json, JsonPath... paths)
已过时。usecollector(String)insteadCollect the first matched value and stop parsing immediately- 参数:
json- jsonpaths- JsonPath- 返回:
- value
-
collectOne
@Deprecated public <T> T collectOne(String json, Class<T> tClass, JsonPath... paths)
已过时。usecollector(String)instead- 类型参数:
T- type- 参数:
json- jsontClass- typepaths- JsonPath- 返回:
- value
-
collectOne
@Deprecated public Object collectOne(Reader reader, String... paths)
已过时。usecollector(InputStream)insteadCollect the first matched value and stop parsing immediately- 参数:
reader- Json readerpaths- JsonPath- 返回:
- Value
-
collectOne
@Deprecated public Object collectOne(Reader reader, JsonPath... paths)
已过时。usecollector(InputStream)insteadCollect the first matched value and stop parsing immediately- 参数:
reader- json readerpaths- JsonPath- 返回:
- Matched value
-
collectOne
@Deprecated public <T> T collectOne(Reader reader, Class<T> tClass, JsonPath... paths)
已过时。usecollector(InputStream)insteadCollect the first matched value and stop parsing immediately- 类型参数:
T- type- 参数:
reader- Json readertClass- typepaths- JsonPath- 返回:
- typed value
-
collectOne
@Deprecated public Object collectOne(InputStream inputStream, String... paths)
已过时。usecollector(InputStream)insteadCollect the first matched value and stop parsing immediately- 参数:
inputStream- Json inpustreampaths- JsonPath- 返回:
- Value
-
collectOne
@Deprecated public Object collectOne(InputStream inputStream, JsonPath... paths)
已过时。usecollector(InputStream)insteadCollect the first matched value and stop parsing immediately- 参数:
inputStream- json inpustreampaths- JsonPath- 返回:
- Matched value
-
collectOne
@Deprecated public <T> T collectOne(InputStream inputStream, Class<T> tClass, JsonPath... paths)
已过时。usecollector(InputStream)insteadCollect the first matched value and stop parsing immediately- 类型参数:
T- type- 参数:
inputStream- Json inpustreamtClass- typepaths- JsonPath- 返回:
- typed value
-
getParserCharset
public Charset getParserCharset()
-
setParserCharset
public void setParserCharset(Charset parserCharset)
-
-