public abstract class NativeObjectContainer extends Object
Modifier | Constructor and Description |
---|---|
protected |
NativeObjectContainer()
Creates the object with an empty native object instance.
|
protected |
NativeObjectContainer(NativeObject nativeObject)
Creates the object with native object instance to be wrapped.
|
Modifier and Type | Method and Description |
---|---|
protected <T extends Array> |
getArrayValue(Key key)
Returns a value (array) into embedded JavaScript object at specific property.
|
protected NativeObject |
getNativeObject()
Returns the native object instance.
|
protected NativeObject |
getValue(Key key)
Returns a value (JavaScript Object) into embedded JavaScript object at specific property.
|
protected boolean |
getValue(Key key,
boolean defaultValue)
Returns a value (boolean) into embedded JavaScript object at specific property.
|
protected CanvasGradient |
getValue(Key key,
CanvasGradient defaultValue)
Returns a value (gradient) into embedded JavaScript object at specific property.
|
protected CanvasPattern |
getValue(Key key,
CanvasPattern defaultValue)
Returns a value (pattern) into embedded JavaScript object at specific property.
|
protected <T extends Key> |
getValue(Key key,
Class<T> clazz,
T defaultValue)
Returns a value (key) into embedded JavaScript object at specific property.
|
protected Date |
getValue(Key key,
Date defaultValue)
Returns a value (date) into embedded JavaScript object at specific property.
|
protected double |
getValue(Key key,
double defaultValue)
Returns a value (double) into embedded JavaScript object at specific property.
|
protected ImageElement |
getValue(Key key,
ImageElement defaultValue)
Returns a value (image) into embedded JavaScript object at specific property.
|
protected int |
getValue(Key key,
int defaultValue)
Returns a value (int) into embedded JavaScript object at specific property.
|
protected String |
getValue(Key key,
String defaultValue)
Returns a value (string) into embedded JavaScript object at specific property.
|
protected ArrayGradient |
getValueOrArray(Key key,
CanvasGradient defaultValue)
Returns a value (array) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a gradient. |
protected ArrayPattern |
getValueOrArray(Key key,
CanvasPattern defaultValue)
Returns a value (array) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a pattern. |
protected ArrayDouble |
getValueOrArray(Key key,
double defaultValue)
Returns a value (array) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a double. |
protected ArrayImage |
getValueOrArray(Key key,
ImageElement defaultValue)
Returns a value (array) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a image. |
protected ArrayInteger |
getValueOrArray(Key key,
int defaultValue)
Returns a value (array) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a integer. |
protected ArrayString |
getValueOrArray(Key key,
Key defaultValue)
Returns a value (array) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a key. |
protected ArrayString |
getValueOrArray(Key key,
String defaultValue)
Returns a value (array) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a string. |
protected boolean |
has(Key... keys)
Returns true if the embedded JavaScript object contains an element at all properties.
|
protected boolean |
has(Key key)
Returns true if the embedded JavaScript object contains an element at specific property.
|
protected List<Key> |
keys()
Returns the list of properties names of the object.
|
protected void |
remove(Key... keys)
Removes a set of elements (by keys) from the embedded JavaScript object.
|
protected void |
remove(Key key)
Removes an element (by key) from the embedded JavaScript object.
|
protected void |
removeIfExists(Key key)
Removes an element (by key) from the embedded JavaScript object if exists.
|
protected void |
setArrayValue(Key key,
ArrayObjectContainerList<?> container)
Sets a value (Array from a container list) into embedded JavaScript object at specific property.
|
protected <T extends Array> |
setArrayValue(Key key,
T value)
Sets a value (Array) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
boolean value)
Sets a value (boolean) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
CallbackProxy.Proxy value)
Sets a value (callback proxy function) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
CanvasGradient value)
Sets a value (gradient) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
CanvasPattern value)
Sets a value (pattern) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
Date value)
Sets a value (date) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
double value)
Sets a value (double) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
ImageElement value)
Sets a value (image) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
int value)
Sets a value (int) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
NativeObject value)
Sets a value (JavaScript Object) into embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
NativeObjectContainer value)
Sets a value (JavaScript Object) into embedded JavaScript object at specific property by object container.
|
protected void |
setValue(Key key,
String value)
Sets a value (string) into embedded JavaScript object at specific property.
|
protected <T extends Key> |
setValue(Key key,
T value)
Sets a value (EnumValue) into embedded JavaScript object at specific property.
|
protected void |
setValueOrArray(Key key,
CanvasGradient... values)
Sets a value (Array or gradient) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a gradient. |
protected void |
setValueOrArray(Key key,
CanvasPattern... values)
Sets a value (Array or pattern) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a pattern. |
protected void |
setValueOrArray(Key key,
double... values)
Sets a value (Array or double) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a double. |
protected void |
setValueOrArray(Key key,
ImageElement... values)
Sets a value (Array or image) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a image. |
protected void |
setValueOrArray(Key key,
int... values)
Sets a value (Array or integer) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a integer. |
protected void |
setValueOrArray(Key key,
IsColor... values)
Sets a value (Array or string by colors) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a string. |
protected void |
setValueOrArray(Key key,
Key... values)
Sets a value (Array or string by keys) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a string. |
protected void |
setValueOrArray(Key key,
String... values)
Sets a value (Array or string) into embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a string. |
String |
toJSON()
Returns the string JSON representation of the object.
|
protected ObjectType |
type(Key key)
Returns the java script type of the property.
|
protected NativeObjectContainer()
protected NativeObjectContainer(NativeObject nativeObject)
nativeObject
- native object instance to be wrapped.protected final NativeObject getNativeObject()
public final String toJSON()
protected final boolean has(Key key)
key
- key of the property of JavaScript object.true
if the embedded JavaScript object contains an element at specific propertyprotected final boolean has(Key... keys)
keys
- set of keys of the properties of JavaScript object.true
if the embedded JavaScript object contains an element at all properties.protected final List<Key> keys()
protected final ObjectType type(Key key)
key
- name of the java script property.protected final void removeIfExists(Key key)
key
- key of the property of JavaScript object.protected final void remove(Key key)
key
- key of the property of JavaScript object.protected final void remove(Key... keys)
keys
- set of keys of the properties of JavaScript object.protected final void setValue(Key key, int value)
key
- key of the property of JavaScript object.value
- value to be setprotected final int getValue(Key key, int defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValueOrArray(Key key, int... values)
key
- key of the property of JavaScript object.values
- values of integers to be setprotected final ArrayInteger getValueOrArray(Key key, int defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single number valueprotected final void setValue(Key key, double value)
key
- key of the property of JavaScript object.value
- value to be setprotected final double getValue(Key key, double defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValueOrArray(Key key, double... values)
key
- key of the property of JavaScript object.values
- values of doubles to be setprotected final ArrayDouble getValueOrArray(Key key, double defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single number valueprotected final void setValue(Key key, boolean value)
key
- key of the property of JavaScript object.value
- value to be setprotected final boolean getValue(Key key, boolean defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final String getValue(Key key, String defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValue(Key key, String value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, String... values)
key
- key of the property of JavaScript object.values
- values of strings to be setprotected final ArrayString getValueOrArray(Key key, String defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single string valueprotected final Date getValue(Key key, Date defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValue(Key key, Date value)
key
- key of the property of JavaScript object.value
- value to be setprotected final NativeObject getValue(Key key)
key
- key of the property of JavaScript object.null
if not thereprotected final void setValue(Key key, NativeObject value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValue(Key key, NativeObjectContainer value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setArrayValue(Key key, ArrayObjectContainerList<?> container)
key
- key of the property of JavaScript object.container
- container of arrayprotected final void setValue(Key key, CallbackProxy.Proxy value)
key
- key of the property of JavaScript object.value
- value to be setprotected final ImageElement getValue(Key key, ImageElement defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValue(Key key, ImageElement value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, ImageElement... values)
key
- key of the property of JavaScript object.values
- images to be setprotected final ArrayImage getValueOrArray(Key key, ImageElement defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single image valueprotected final CanvasGradient getValue(Key key, CanvasGradient defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValue(Key key, CanvasGradient value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, CanvasGradient... values)
key
- key of the property of JavaScript object.values
- images to be setprotected final ArrayGradient getValueOrArray(Key key, CanvasGradient defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single gradient valueprotected final CanvasPattern getValue(Key key, CanvasPattern defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValue(Key key, CanvasPattern value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, CanvasPattern... values)
key
- key of the property of JavaScript object.values
- images to be setprotected final ArrayPattern getValueOrArray(Key key, CanvasPattern defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single pattern valueprotected final <T extends Key> T getValue(Key key, Class<T> clazz, T defaultValue)
T
- type of keykey
- key of the property of JavaScript object.clazz
- class of object to get all enumeration valuesdefaultValue
- default value if the property is missingprotected final <T extends Key> void setValue(Key key, T value)
T
- type of keykey
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, Key... values)
key
- key of the property of JavaScript object.values
- value of keys to be setprotected final ArrayString getValueOrArray(Key key, Key defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single key valuenull
if not existprotected final <T extends Array> T getArrayValue(Key key)
T
- type of arraykey
- key of the property of JavaScript object.null
if not existprotected final <T extends Array> void setArrayValue(Key key, T value)
T
- type of arraykey
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, IsColor... values)
key
- key of the property of JavaScript object.values
- values of colors to be set