public class JSON extends Object
ObjectMapper
and thus
honors standard Jackson annotations to control serialization/deserialization.
In addition, this class searches for types registered via TypeResolutionProvider
.Constructor and Description |
---|
JSON()
Create a new JSON instance.
|
Modifier and Type | Method and Description |
---|---|
String |
format(Object obj)
Formats the object as JSON
|
<T> T |
parse(Reader src,
Class<T> asClass)
Parses the given reader as a JSON object of the given type
|
<T> T |
parse(String json,
Class<T> asClass)
Parses the given string as a JSON object of the given type
|
String |
prettyPrint(Object obj)
Pretty-prints the object as JSON
|
void |
relaxStandard()
Relax the JSON standard while parsing.
|
public void relaxStandard()
public <T> T parse(Reader src, Class<T> asClass)
T
- the type to parse assrc
- the readerasClass
- the type to parse aspublic <T> T parse(String json, Class<T> asClass)
T
- the type to parse asjson
- the stringasClass
- the type to parse aspublic String format(Object obj)
obj
- the object to formatCopyright © 2020 Actian Corporation. All rights reserved.