public class Configurations extends Object
Modifier and Type | Method and Description |
---|---|
static ConfigurationReader.Builder |
buildReader()
Get a builder to create a configuration reader
|
static ConfigurationWriter.Builder |
buildWriter()
Get a builder to create a configuration writer
|
static javax.json.JsonValue |
convertToJsonValue(Object value)
Convert an object to a JSON value.
|
static Object |
convertToObject(javax.json.JsonValue value)
Convert a json value into an object.
|
static Reader |
jsonCommentAwareReader(Reader reader)
Create a reader handling comments in JSON.
|
static Hashtable<String,Object> |
newConfiguration()
Create a new map for configuration properties The returned map keeps the
order of properties added and is using case-insensitive keys.
|
public static ConfigurationReader.Builder buildReader()
public static ConfigurationWriter.Builder buildWriter()
public static Reader jsonCommentAwareReader(Reader reader) throws IOException
reader
- Reader for the JSONIOException
- If reading fails.public static Hashtable<String,Object> newConfiguration()
public static Object convertToObject(javax.json.JsonValue value)
null
: if the provided value is null
or
ValueType#NULL
value
- The json valuenull
if the provided value is null
or
ValueType#NULL
public static javax.json.JsonValue convertToJsonValue(Object value)
JsonValue.NULL
: if the provided value is null
JsonValue.TRUE
or JsonValue.FALSE
: if the provided value is Boolean.
JsonValue.ValueType#NUMBER
: if the value is a Integer, Long, Float, Double, Byte, Short
JsonValue.ValueType#OBJECT
: if the value is a map
JsonValue.ValueType#ARRAY
: if the value is an array or a collection
JsonValue.ValueType#STRING
: otherwise, calling toString()
on the value.
value
- The objectCopyright © 2006–2021 The Apache Software Foundation. All rights reserved.