public class JSONResolvable extends java.lang.Object implements Resolvable
JSONObject
and Resolvable
. Wraps an
instance of JSONObject
and resolves properties.Modifier and Type | Field and Description |
---|---|
protected org.json.JSONObject |
jsonObject
wapped JSON object
|
Constructor and Description |
---|
JSONResolvable(org.json.JSONObject jsonObject)
Create an instance of the JSON Resolvable wrapper
|
Modifier and Type | Method and Description |
---|---|
boolean |
canResolve()
Check whether the resolvable is capable of resolving properties right
now.
|
java.lang.Object |
get(java.lang.String key)
Get the property named by key or null if the property does not exist or
is not set.
|
java.lang.Object |
getProperty(java.lang.String key)
Get the property named by key or null if the property does not exist or
is not set.
|
protected static java.lang.Object |
transformValue(java.lang.Object value)
Helper method to transform the given value from JSON to Resolvable
|
public JSONResolvable(org.json.JSONObject jsonObject)
jsonObject
- wrapped JSON objectpublic boolean canResolve()
Resolvable
Resolvable.getProperty(String)
or Resolvable.get(String)
will return null.canResolve
in interface Resolvable
public java.lang.Object get(java.lang.String key)
Resolvable
get
in interface Resolvable
key
- key of the propertypublic java.lang.Object getProperty(java.lang.String key)
Resolvable
Resolvable.get(String)
.getProperty
in interface Resolvable
key
- key of the propertyprotected static java.lang.Object transformValue(java.lang.Object value) throws org.json.JSONException
value
- value to transformorg.json.JSONException
- if transformation failsCopyright © 2022 Gentics Software. All Rights Reserved.