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> T |
checkDefaultValuesArgument(T defaultValues)
Checks if the argument, which is assuming is a default values instance, is consistent.
If not, throws IllegalArgumentException . |
protected boolean |
empty()
Returns
true if there is at least a property, otherwise false . |
protected <T extends Array> |
getArrayValue(Key key)
Returns a value (array) in the embedded JavaScript object at specific property.
|
protected BaseHtmlElement |
getElement(Key key)
Returns a value (BaseHtmlElement) in the embedded JavaScript object at specific property.
|
protected String |
getIncrementalId()
Returns the incremental id of the object.
|
protected Chart |
getNativeChart(Key key)
Returns a value (chart) in the embedded JavaScript object at specific property.
|
protected BaseNativeEvent |
getNativeEvent(Key key)
Returns a value (native event) in the embedded JavaScript object at specific property.
|
protected NativeObject |
getNativeObject()
Returns the native object instance.
|
protected NativeObject |
getValue(Key key)
Returns a value (JavaScript Object) in the embedded JavaScript object at specific property.
|
protected boolean |
getValue(Key key,
boolean defaultValue)
Returns a value (boolean) in the embedded JavaScript object at specific property.
|
protected Canvas |
getValue(Key key,
Canvas defaultValue)
Returns a value (canvas) in the embedded JavaScript object at specific property.
|
protected CanvasGradientItem |
getValue(Key key,
CanvasGradientItem defaultValue)
Returns a value (gradient) in the embedded JavaScript object at specific property.
|
protected CanvasPatternItem |
getValue(Key key,
CanvasPatternItem defaultValue)
Returns a value (pattern) in the embedded JavaScript object at specific property.
|
protected Date |
getValue(Key key,
Date defaultValue)
Returns a value (date) in the embedded JavaScript object at specific property.
|
protected double |
getValue(Key key,
double defaultValue)
Returns a value (double) in the embedded JavaScript object at specific property.
|
protected Img |
getValue(Key key,
Img defaultValue)
Returns a value (image) in the embedded JavaScript object at specific property.
|
protected int |
getValue(Key key,
int defaultValue)
Returns a value (int) in the embedded JavaScript object at specific property.
|
protected String |
getValue(Key key,
Key defaultValue)
Returns a value (string) in the embedded JavaScript object at specific property.
|
protected ScaleId |
getValue(Key key,
ScaleId defaultValue)
Returns a value (ScaleId) in the embedded JavaScript object at specific property.
|
protected String |
getValue(Key key,
String defaultValue)
Returns a value (string) in the embedded JavaScript object at specific property.
|
protected <T extends Key> |
getValue(Key key,
T[] enumValues,
T defaultValue)
Returns a value (key) in the embedded JavaScript object at specific property.
|
protected Date |
getValueForMultipleKeyTypes(Key key,
Date defaultsValue)
Returns the value of a property checking if the type of current value is a OBJECT (as a date).
|
protected double |
getValueForMultipleKeyTypes(Key key,
double defaultsValue)
Returns the value of a property checking if the type of current value is a NUMBER.
|
protected String |
getValueForMultipleKeyTypes(Key key,
String defaultsValue)
Returns the value of a property checking if the type of current value is a STRING.
|
protected ArrayCanvas |
getValueOrArray(Key key,
Canvas defaultValue)
Returns a value (array) in the embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a canvas. |
protected ArrayGradient |
getValueOrArray(Key key,
CanvasGradientItem defaultValue)
Returns a value (array) in the 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,
CanvasPatternItem defaultValue)
Returns a value (array) in the 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) in the 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,
Img defaultValue)
Returns a value (array) in the 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) in the 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) in the 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) in the 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 boolean |
isType(Key key,
ObjectType... types)
Returns
true if the type of the property is equals to one of the object types passed as argument. |
protected List<Key> |
keys()
Returns the list of properties names of the object.
|
ChartEnvelop<NativeObject> |
loadNativeObject(ChartEnvelop<NativeObject> envelop)
Returns the native object instance inside an envelop.
It can be called only from org.pepstock.charba.client package. |
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 |
setArrayValue(Key key,
ArrayDoubleArrayList<?> container)
Sets a value (Array from a double array container list) in the embedded JavaScript object at specific property.
|
protected void |
setArrayValue(Key key,
ArrayObjectContainerList<?> container)
Sets a value (Array from a container list) in the embedded JavaScript object at specific property.
|
protected <T extends Array> |
setArrayValue(Key key,
T value)
Sets a value (Array) in the embedded JavaScript object at specific property.
|
protected void |
setElement(Key key,
BaseHtmlElement value)
Sets a value (BaseHtmlElement) in the embedded JavaScript object at specific property.
|
protected void |
setEmptyValue(Key key)
Sets a value (an empty JavaScript Object) in the embedded JavaScript object at specific property.
|
protected void |
setNewIncrementalId()
Stores new incremental id if not previously stored.
|
protected void |
setNewIncrementalId(String prefix)
Stores new incremental id if not previously stored.
|
protected void |
setValue(Key key,
BaseNativeEvent value)
Sets a value (event) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
boolean value)
Sets a value (boolean) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
CallbackProxy.Proxy value)
Sets a value (callback proxy function) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
Canvas value)
Sets a value (canvas) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
CanvasGradientItem value)
Sets a value (gradient) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
CanvasPatternItem value)
Sets a value (pattern) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
Chart value)
Sets a value (chart) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
Date value)
Sets a value (date) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
double value)
Sets a value (double) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
Img value)
Sets a value (image) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
int value)
Sets a value (int) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
NativeArrayContainer<?> value)
Sets a value (JavaScript Object) in the embedded JavaScript object at specific property by array container.
|
protected void |
setValue(Key key,
NativeCallback value)
Sets a value (native callback function) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
NativeObject value)
Sets a value (JavaScript Object) in the embedded JavaScript object at specific property.
|
protected void |
setValue(Key key,
NativeObjectContainer value)
Sets a value (JavaScript Object) in the embedded JavaScript object at specific property by object container.
|
protected void |
setValue(Key key,
String value)
Sets a value (string) in the embedded JavaScript object at specific property.
|
protected <T extends Key> |
setValue(Key key,
T value)
Sets a value (EnumValue) in the embedded JavaScript object at specific property.
|
protected void |
setValueOrArray(Key key,
Canvas... values)
Sets a value (array or canvas) in the 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,
CanvasGradientItem... values)
Sets a value (Array or gradient) in the 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,
CanvasPatternItem... values)
Sets a value (Array or pattern) in the 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) in the 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,
Img... values)
Sets a value (array or image) in the 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) in the 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) in the 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) in the 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,
NativeObjectContainer... values)
Sets a value (array or native object container) in the embedded JavaScript object at specific property.
This must be used when a java script property can contain an array or a native object container. |
protected void |
setValueOrArray(Key key,
String... values)
Sets a value (Array or string) in the 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 <T> T checkDefaultValuesArgument(T defaultValues)
IllegalArgumentException
.T
- type of default argumentdefaultValues
- default values instance to checkprotected final NativeObject getNativeObject()
public final ChartEnvelop<NativeObject> loadNativeObject(ChartEnvelop<NativeObject> envelop)
org.pepstock.charba.client
package.envelop
- envelop instance which will contain the native objectpublic final String toJSON()
protected final boolean empty()
true
if there is at least a property, otherwise false
.true
if there is at least a property, otherwise false
.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 boolean isType(Key key, ObjectType... types)
true
if the type of the property is equals to one of the object types passed as argument.key
- name of the java script property.types
- types to check against the type of the property.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 setEmptyValue(Key key)
key
- key of the property of JavaScript object.protected final void setValue(Key key, NativeObjectContainer value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, NativeObjectContainer... values)
key
- key of the property of JavaScript object.values
- native object containers 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, NativeArrayContainer<?> value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setArrayValue(Key key, ArrayDoubleArrayList<?> container)
key
- key of the property of JavaScript object.container
- container of array of doublesprotected final void setValue(Key key, CallbackProxy.Proxy value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValue(Key key, NativeCallback value)
key
- key of the property of JavaScript object.value
- value to be setprotected final Canvas getValue(Key key, Canvas defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValue(Key key, Canvas value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, Canvas... values)
key
- key of the property of JavaScript object.values
- images to be setprotected final ArrayCanvas getValueOrArray(Key key, Canvas defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single canvas valueprotected final Img getValue(Key key, Img defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValue(Key key, Img value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, Img... values)
key
- key of the property of JavaScript object.values
- images to be setprotected final ArrayImage getValueOrArray(Key key, Img defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single image valueprotected final CanvasGradientItem getValue(Key key, CanvasGradientItem defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValue(Key key, CanvasGradientItem value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, CanvasGradientItem... values)
key
- key of the property of JavaScript object.values
- gradients to be setprotected final ArrayGradient getValueOrArray(Key key, CanvasGradientItem defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single gradient valueprotected final CanvasPatternItem getValue(Key key, CanvasPatternItem defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missingprotected final void setValue(Key key, CanvasPatternItem value)
key
- key of the property of JavaScript object.value
- value to be setprotected final void setValueOrArray(Key key, CanvasPatternItem... values)
key
- key of the property of JavaScript object.values
- patterns to be setprotected final ArrayPattern getValueOrArray(Key key, CanvasPatternItem defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single pattern valueprotected final String getValue(Key key, Key defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value as key 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 ScaleId getValue(Key key, ScaleId defaultValue)
key
- key of the property of JavaScript object.defaultValue
- default value as key if the property is missingprotected final <T extends Key> T getValue(Key key, T[] enumValues, T defaultValue)
T
- type of keykey
- key of the property of JavaScript object.enumValues
- all enumeration valuesdefaultValue
- default value if the property is missingprotected 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 setprotected final void setValue(Key key, Chart value)
key
- key of the property of JavaScript object.value
- value to be setprotected final Chart getNativeChart(Key key)
key
- key of the property of JavaScript object.protected final void setElement(Key key, BaseHtmlElement value)
key
- key of the property of JavaScript object.value
- value to be setprotected final BaseHtmlElement getElement(Key key)
key
- key of the property of JavaScript object.protected final void setValue(Key key, BaseNativeEvent value)
key
- key of the property of JavaScript object.value
- value to be setprotected final BaseNativeEvent getNativeEvent(Key key)
key
- key of the property of JavaScript object.protected final String getValueForMultipleKeyTypes(Key key, String defaultsValue)
key
- key of the property of JavaScript objectdefaultsValue
- default value if the value was stored as single key valueprotected final double getValueForMultipleKeyTypes(Key key, double defaultsValue)
key
- key of the property of JavaScript objectdefaultsValue
- default value if the value was stored as single key valueprotected final Date getValueForMultipleKeyTypes(Key key, Date defaultsValue)
key
- key of the property of JavaScript objectdefaultsValue
- default value if the value was stored as single key valueprotected final void setNewIncrementalId()
protected final void setNewIncrementalId(String prefix)
prefix
- prefix to add to the value of incremental id.protected final String getIncrementalId()