Package io.ebean.service
Interface SpiJsonService
-
public interface SpiJsonService
JSON service that Ebean is expected to provide. Supports converting between JSON content and simple java Maps/Lists.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Objectparse(com.fasterxml.jackson.core.JsonParser parser)Parse the json and return as a List or Map.Objectparse(Reader reader)Parse the json and return as a List or Map.Objectparse(String json)Parse the json and return as a List or Map.List<Object>parseList(com.fasterxml.jackson.core.JsonParser parser)Parse the json and return as a List taking a JsonParser.<T> List<T>parseList(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.core.JsonToken currentToken)Parse the json returning as a List taking into account the current token.List<Object>parseList(Reader reader)Parse the json and return as a List taking a Reader.List<Object>parseList(String json)Parse the json and return as a List.<T> List<T>parseList(String json, boolean modifyAware)Parse the json and return as a modify aware List.Map<String,Object>parseObject(com.fasterxml.jackson.core.JsonParser parser)Parse the json and return as a Map taking a JsonParser.Map<String,Object>parseObject(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.core.JsonToken token)Parse the json and return as a Map taking a JsonParser and a starting token.Map<String,Object>parseObject(Reader reader)Parse the json and return as a Map taking a reader.Map<String,Object>parseObject(Reader reader, boolean modifyAware)Parse the json and return as a Map taking a reader.Map<String,Object>parseObject(String json)Parse the json and return as a Map.Map<String,Object>parseObject(String json, boolean modifyAware)Parse the json and return as a Map additionally specifying if the returned map should be modify aware meaning that it can detect when it has been modified.<T> Set<T>parseSet(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.core.JsonToken currentToken)Parse the json returning as a Set taking into account the current token.<T> Set<T>parseSet(String json, boolean modifyAware)Parse the json returning a Set that might be modify aware.Stringwrite(Object object)Write the nested Map/List as json.voidwrite(Object object, com.fasterxml.jackson.core.JsonGenerator jsonGenerator)Write the nested Map/List as json to the jsonGenerator.voidwrite(Object object, Writer writer)Write the nested Map/List as json to the writer.voidwriteCollection(Collection<Object> collection, com.fasterxml.jackson.core.JsonGenerator jsonGenerator)Write the collection as json array to the jsonGenerator.
-
-
-
Method Detail
-
write
String write(Object object) throws IOException
Write the nested Map/List as json.- Throws:
IOException
-
write
void write(Object object, Writer writer) throws IOException
Write the nested Map/List as json to the writer.- Throws:
IOException
-
write
void write(Object object, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws IOException
Write the nested Map/List as json to the jsonGenerator.- Throws:
IOException
-
writeCollection
void writeCollection(Collection<Object> collection, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws IOException
Write the collection as json array to the jsonGenerator.- Throws:
IOException
-
parseObject
Map<String,Object> parseObject(String json, boolean modifyAware) throws IOException
Parse the json and return as a Map additionally specifying if the returned map should be modify aware meaning that it can detect when it has been modified.- Throws:
IOException
-
parseObject
Map<String,Object> parseObject(String json) throws IOException
Parse the json and return as a Map.- Throws:
IOException
-
parseObject
Map<String,Object> parseObject(Reader reader, boolean modifyAware) throws IOException
Parse the json and return as a Map taking a reader.- Throws:
IOException
-
parseObject
Map<String,Object> parseObject(Reader reader) throws IOException
Parse the json and return as a Map taking a reader.- Throws:
IOException
-
parseObject
Map<String,Object> parseObject(com.fasterxml.jackson.core.JsonParser parser) throws IOException
Parse the json and return as a Map taking a JsonParser.- Throws:
IOException
-
parseObject
Map<String,Object> parseObject(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.core.JsonToken token) throws IOException
Parse the json and return as a Map taking a JsonParser and a starting token.Used when the first token is checked to see if the value is null prior to calling this.
- Throws:
IOException
-
parseList
<T> List<T> parseList(String json, boolean modifyAware) throws IOException
Parse the json and return as a modify aware List.- Throws:
IOException
-
parseList
List<Object> parseList(String json) throws IOException
Parse the json and return as a List.- Throws:
IOException
-
parseList
List<Object> parseList(Reader reader) throws IOException
Parse the json and return as a List taking a Reader.- Throws:
IOException
-
parseList
List<Object> parseList(com.fasterxml.jackson.core.JsonParser parser) throws IOException
Parse the json and return as a List taking a JsonParser.- Throws:
IOException
-
parseList
<T> List<T> parseList(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.core.JsonToken currentToken) throws IOException
Parse the json returning as a List taking into account the current token.- Throws:
IOException
-
parse
Object parse(String json) throws IOException
Parse the json and return as a List or Map.- Throws:
IOException
-
parse
Object parse(Reader reader) throws IOException
Parse the json and return as a List or Map.- Throws:
IOException
-
parse
Object parse(com.fasterxml.jackson.core.JsonParser parser) throws IOException
Parse the json and return as a List or Map.- Throws:
IOException
-
parseSet
<T> Set<T> parseSet(String json, boolean modifyAware) throws IOException
Parse the json returning a Set that might be modify aware.- Throws:
IOException
-
parseSet
<T> Set<T> parseSet(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.core.JsonToken currentToken) throws IOException
Parse the json returning as a Set taking into account the current token.- Throws:
IOException
-
-