Package com.openfin.desktop
Class JsonBean
- java.lang.Object
-
- com.openfin.desktop.JsonBean
-
- Direct Known Subclasses:
AcceleratorOptions,ApiOptions,ApplicationOptions,AutoResizeOptions,ButtonOptions,ContentNavigationOptions,Context,ContextGroupInfo,ContextMenuSettings,CustomData,DisplayMetadata,FeedApplication,FindInPageOptions,Identity,IFrameOptions,Intent,LayoutContentOptionsImpl,LayoutOptions,MonitorDetails,MonitorInfo,NotificationActionResult,NotificationEvent,NotificationIndicator,NotificationOptions,NotificationSourceDesktop,NotificationSourceFeed,PlatformSnapshot,PlatformSnapshotDetails,PlatformSnapshotOptions,PlatformViewOptions,PrinterInfo,PrintOptions,ProviderStatus,RVMOptions,WindowOptions
public class JsonBean extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected org.json.JSONObjectjson
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectget(String key)org.json.JSONArraygetArray(String name)BooleangetBoolean(String name)booleangetBooleanValue(String property)Helper method to extract data field from underlying JSONObjectbooleangetBooleanValue(String property, boolean defaultValue)Helper method to extract data field from underlying JSONObjectdoublegetDoubleValue(String property)Helper method to extract data field from underlying JSONObjectdoublegetDoubleValue(String property, double defaultValue)IntegergetInteger(String name)intgetIntegerValue(String property)Helper method to extract data field from underlying JSONObjectorg.json.JSONObjectgetJson()Gets the underlying JSONObject<T> TgetJsonBean(String name, Class<T> clazz)<T> TgetJsonBean(org.json.JSONObject obj, Class<T> clazz)<T extends JsonBean>
List<T>getJsonBeanList(String name, Class<T> clazz)org.json.JSONObjectgetJsonCopy()Gets a copy of underlying JSONObjectorg.json.JSONObjectgetJsonValue(String property)Helper method to extract data field from underlying JSONObject<T> List<T>getList(String name)RectanglegetRectangle(String name)StringgetString(String property)Helper method to extract data field from underlying JSONObjectJsonBeanput(String key, Object value)Set value for a property<T> voidsetArray(String name, Collection<T> value)voidsetBoolean(String name, Boolean value)voidsetInteger(String name, Integer value)<T> voidsetJsonArray(String name, List<T> values)<T extends JsonBean>
voidsetJsonBean(String name, T jsonBean)voidsetLong(String name, Long value)voidsetRectangle(String name, Rectangle rect)voidsetString(String name, String value)StringtoString()
-
-
-
Method Detail
-
getJson
public org.json.JSONObject getJson()
Gets the underlying JSONObject- Returns:
- JSONObject
-
getJsonCopy
public final org.json.JSONObject getJsonCopy()
Gets a copy of underlying JSONObject- Returns:
- JSONObject
-
getString
public String getString(String property)
Helper method to extract data field from underlying JSONObject- Parameters:
property- name of the field- Returns:
- String value of a field
-
getIntegerValue
public int getIntegerValue(String property)
Helper method to extract data field from underlying JSONObject- Parameters:
property- name of the field- Returns:
- Integer value of a field
-
getDoubleValue
public double getDoubleValue(String property)
Helper method to extract data field from underlying JSONObject- Parameters:
property- name of the field- Returns:
- Double value of a field
-
getDoubleValue
public double getDoubleValue(String property, double defaultValue)
-
getBooleanValue
public boolean getBooleanValue(String property)
Helper method to extract data field from underlying JSONObject- Parameters:
property- name of the field- Returns:
- Boolean value of a field
-
getBooleanValue
public boolean getBooleanValue(String property, boolean defaultValue)
Helper method to extract data field from underlying JSONObject- Parameters:
property- name of the fielddefaultValue- default value if property is missing- Returns:
- Boolean value of a field
-
getJsonValue
public org.json.JSONObject getJsonValue(String property)
Helper method to extract data field from underlying JSONObject- Parameters:
property- name of the field- Returns:
- JSONObject value of a field
-
put
public JsonBean put(String key, Object value) throws org.json.JSONException
Set value for a property- Parameters:
key- name of the propertyvalue- value- Returns:
- current object
- Throws:
org.json.JSONException- from JSONObject.put
-
setArray
public <T> void setArray(String name, Collection<T> value)
-
getArray
public org.json.JSONArray getArray(String name)
-
getJsonBean
public <T> T getJsonBean(org.json.JSONObject obj, Class<T> clazz)
-
-