public interface JsonUtil
Modifier and Type | Method and Description |
---|---|
default void |
expectEvent(javax.json.stream.JsonParser.Event actual,
javax.json.stream.JsonParser.Event expected) |
default void |
expectEvent(javax.json.stream.JsonParser json,
javax.json.stream.JsonParser.Event event) |
default <T> T |
read(javax.json.stream.JsonParser json,
GenericType<T> type) |
<T> T |
read(javax.json.stream.JsonParser json,
GenericType<T> type,
javax.json.stream.JsonParser.Event e) |
default boolean |
readBoolean(javax.json.stream.JsonParser.Event e) |
<E> void |
readCollection(javax.json.stream.JsonParser json,
Collection<E> collection,
GenericType<E> type) |
<C extends Collection<?>> |
readCollection(javax.json.stream.JsonParser json,
GenericType<C> type) |
<E extends Enum<E>> |
readEnum(javax.json.stream.JsonParser json,
Class<E> enumType) |
<M extends Map<?,?>> |
readMap(javax.json.stream.JsonParser json,
GenericType<M> type) |
default <N extends Number> |
readNumber(javax.json.stream.JsonParser json,
Class<N> type) |
default void |
skipValue(javax.json.stream.JsonParser json)
Skips the current value from the
JsonParser . |
default void |
skipValue(javax.json.stream.JsonParser json,
javax.json.stream.JsonParser.Event e)
Skips the current value from the
JsonParser when the current JsonParser.Event was already
read and is given. |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
BigDecimal value)
An implementation of
JsonSupport.toJson(JsonGenerator) for a given BigDecimal . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
BigInteger value)
An implementation of
JsonSupport.toJson(JsonGenerator) for a given BigInteger . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
boolean value)
An implementation of
JsonSupport.toJson(JsonGenerator) for a given Boolean value. |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
double value)
An implementation of
JsonSupport.toJson(JsonGenerator) for a given Double . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
int value)
An implementation of
JsonSupport.toJson(JsonGenerator) for a given Integer . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
Iterable<?> value)
An implementation of
JsonSupport.toJson(JsonGenerator) for a given Iterable . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
long value)
An implementation of
JsonSupport.toJson(JsonGenerator) for a given Long . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
Map<?,?> value)
A implementation of
JsonSupport.toJson(JsonGenerator) for a given Map . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
Number value)
A generic implementation of
JsonSupport.toJson(JsonGenerator) for a given Number . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
Object value)
A generic implementation of
JsonSupport.toJson(JsonGenerator) for a given value . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
Object[] value)
A implementation of
JsonSupport.toJson(JsonGenerator) for a given array . |
default void |
write(javax.json.stream.JsonGenerator json,
String property,
String value)
An implementation of
JsonSupport.toJson(JsonGenerator) for a given String value. |
default void |
writeNull(javax.json.stream.JsonGenerator json,
String property)
An implementation of
JsonSupport.toJson(JsonGenerator) to write the null value. |
default void write(javax.json.stream.JsonGenerator json, String property, Object value)
JsonSupport.toJson(JsonGenerator)
for a given value
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, String value)
JsonSupport.toJson(JsonGenerator)
for a given String
value.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, boolean value)
JsonSupport.toJson(JsonGenerator)
for a given Boolean
value.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, Number value)
JsonSupport.toJson(JsonGenerator)
for a given Number
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, long value)
JsonSupport.toJson(JsonGenerator)
for a given Long
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, double value)
JsonSupport.toJson(JsonGenerator)
for a given Double
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, BigDecimal value)
JsonSupport.toJson(JsonGenerator)
for a given BigDecimal
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, BigInteger value)
JsonSupport.toJson(JsonGenerator)
for a given BigInteger
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, int value)
JsonSupport.toJson(JsonGenerator)
for a given Integer
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void writeNull(javax.json.stream.JsonGenerator json, String property)
JsonSupport.toJson(JsonGenerator)
to write the null
value.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write null
).default void write(javax.json.stream.JsonGenerator json, String property, Iterable<?> value)
JsonSupport.toJson(JsonGenerator)
for a given Iterable
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, Map<?,?> value)
JsonSupport.toJson(JsonGenerator)
for a given Map
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON. May be null
.default void write(javax.json.stream.JsonGenerator json, String property, Object[] value)
JsonSupport.toJson(JsonGenerator)
for a given array
.json
- the JsonGenerator
.property
- the name of the JSON property or null
for no property (just to write the value
).value
- the value to write as JSON array. May be null
.default void expectEvent(javax.json.stream.JsonParser json, javax.json.stream.JsonParser.Event event) throws ObjectMismatchException
json
- the JsonParser
to get the next
JsonParser.Event
from.event
- the expected JsonParser.Event
.ObjectMismatchException
- if the expected JsonParser.Event
does not match.default void expectEvent(javax.json.stream.JsonParser.Event actual, javax.json.stream.JsonParser.Event expected)
actual
- the actual JsonParser.Event
received from JsonParser
.expected
- the expected JsonParser.Event
.ObjectMismatchException
- if the expected JsonParser.Event
does not match.default <T> T read(javax.json.stream.JsonParser json, GenericType<T> type)
T
- the generic type of the object to parse.json
- the JsonParser
.type
- the GenericType
of the requested object to parse.<T> T read(javax.json.stream.JsonParser json, GenericType<T> type, javax.json.stream.JsonParser.Event e)
T
- the generic type of the object to parse.json
- the JsonParser
.type
- the GenericType
of the requested object to parse.e
- the current JsonParser.Event
.collectionReflectionUtil
- the CollectionReflectionUtil
instance.stringUtil
- the StringUtil
instance.<E extends Enum<E>> E readEnum(javax.json.stream.JsonParser json, Class<E> enumType) throws IllegalCaseException
E
- the generic type of the Enum
to parse.json
- the JsonParser
.enumType
- the Class
reflecting the Enum
to parse.stringUtil
- the StringUtil
instance.Enum
constant.IllegalCaseException
- if no such Enum
constant exists.<C extends Collection<?>> C readCollection(javax.json.stream.JsonParser json, GenericType<C> type)
C
- the generic type of the Collection
.json
- the JsonParser
.type
- the GenericType
of the Collection
.Collection
.<E> void readCollection(javax.json.stream.JsonParser json, Collection<E> collection, GenericType<E> type)
E
- the generic type of the elements
in the Collection
.json
- the JsonParser
.collection
- the Collection
where to add
the elements parsed from JSON.type
- the GenericType
of the elements
in the Collection
.<M extends Map<?,?>> M readMap(javax.json.stream.JsonParser json, GenericType<M> type)
M
- the generic type of the Map
.json
- the JsonParser
.type
- the GenericType
of the Map
.Map
.default boolean readBoolean(javax.json.stream.JsonParser.Event e)
e
- the JSON JsonParser.Event
.Boolean
value.default <N extends Number> N readNumber(javax.json.stream.JsonParser json, Class<N> type)
default void skipValue(javax.json.stream.JsonParser json)
JsonParser
.json
- the JsonParser
.default void skipValue(javax.json.stream.JsonParser json, javax.json.stream.JsonParser.Event e)
JsonParser
when the current JsonParser.Event
was already
read
and is given.json
- the JsonParser
.e
- the JsonParser.Event
that was already read
before.Copyright © 2001–2016 mmm-Team. All rights reserved.