Class JsonFlattenerFactory
- java.lang.Object
-
- com.github.wnameless.json.flattener.JsonFlattenerFactory
-
public final class JsonFlattenerFactory extends Object
JsonFlattenerFactorypreserves the configuration of aJsonFlattener, in doing so, any input JSON data can be used to create aJsonFlattenerobject with the same configuration.- Author:
- Wei-Ming Wu
-
-
Constructor Summary
Constructors Constructor Description JsonFlattenerFactory(Consumer<JsonFlattener> configurer)Returns aJsonFlattenerFactory.JsonFlattenerFactory(Consumer<JsonFlattener> configurer, com.github.wnameless.json.base.JsonCore<?> jsonCore)Returns aJsonFlattenerFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonFlattenerbuild(com.github.wnameless.json.base.JsonValueBase<?> json)Creates aJsonFlattenerby givenJsonValueBaseand configures it with the configurer and jsonCore within thisJsonFlattenerFactory.JsonFlattenerbuild(Reader jsonReader)Creates aJsonFlattenerby given JSON reader and configures it with the configurer and jsonCore within thisJsonFlattenerFactory.JsonFlattenerbuild(String json)Creates aJsonFlattenerby given JSON string and configures it with the configurer and jsonCore within thisJsonFlattenerFactory.booleanequals(Object o)inthashCode()StringtoString()
-
-
-
Constructor Detail
-
JsonFlattenerFactory
public JsonFlattenerFactory(Consumer<JsonFlattener> configurer)
Returns aJsonFlattenerFactory.- Parameters:
configurer- a functional interface used to set up the configuration of aJsonFlattener.
-
JsonFlattenerFactory
public JsonFlattenerFactory(Consumer<JsonFlattener> configurer, com.github.wnameless.json.base.JsonCore<?> jsonCore)
Returns aJsonFlattenerFactory.- Parameters:
configurer- a functional interface used to set up the configuration of aJsonFlattener.jsonCore- aJsonCore
-
-
Method Detail
-
build
public JsonFlattener build(String json)
Creates aJsonFlattenerby given JSON string and configures it with the configurer and jsonCore within thisJsonFlattenerFactory.- Parameters:
json- the JSON string- Returns:
- a
JsonFlattener
-
build
public JsonFlattener build(com.github.wnameless.json.base.JsonValueBase<?> json)
Creates aJsonFlattenerby givenJsonValueBaseand configures it with the configurer and jsonCore within thisJsonFlattenerFactory.- Parameters:
json- theJsonValueBase- Returns:
- a
JsonFlattener
-
build
public JsonFlattener build(Reader jsonReader) throws IOException
Creates aJsonFlattenerby given JSON reader and configures it with the configurer and jsonCore within thisJsonFlattenerFactory.- Parameters:
jsonReader- a JSON reader- Returns:
- a
JsonFlattener - Throws:
IOException- if the jsonReader cannot be read
-
-