Class NativeObjectContainer
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- Direct Known Subclasses:
AbstractDataPoint
,AbstractFont
,AbstractImmutableFont
,AbstractNode
,AbstractPadding
,AbstractReadOnlyPoint
,ActiveDatasetElement
,AnimationItem
,ArcBorderRadius
,BarBorderRadius
,BarBorderWidth
,BaseBoxItem
,CanvasObject
,ChartContext
,ChartEventContext
,Clip
,Configuration
,Data
,DatasetElement
,DatasetElementOptions
,DatasetItem
,DatasetItemController
,DatasetPoint
,DatasetReference
,DateAdapterFormats
,DateAdapterOptions
,DateTimeFormatOptions
,Feature
,FormatPart
,GradientColor
,Graticule
,Labels
,Labels
,LabelsHandler
,Limits
,Margin
,NumberFormatOptions
,Parsed
,PluginEventArgument
,PluginResizeArgument
,PluginScaleArgument
,PluginTooltipArgument
,PluginUpdateArgument
,PositionerContext
,Priority
,PropertyHandler
,ScaleRange
,ScalesNode
,ScaleTickItem
,SelectionCleaner
,SizeItem
,ToastItem
,TooltipBodyItem
,TooltipItem
,TooltipLabelColor
,TooltipLabelPointStyle
,TooltipModel
,TopoJson
,UpdateConfiguration
public abstract class NativeObjectContainer extends Object
Base class for all classes which are wrapping a native java script object.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Modifier Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> T
checkDefaultValuesArgument(T defaultValues)
Checks if the argument, which is assuming is a default values instance, is consistent.
If not, throwsIllegalArgumentException
.protected boolean
empty()
Returnstrue
if there is at least a property, otherwisefalse
.protected <T extends Array>
TgetArrayValue(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 double
getValue(Key key, double defaultValue)
Returns a value (double) 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, String defaultValue)
Returns a value (string) 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 String
getValue(Key key, Key defaultValue)
Returns a value (string) 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 Img
getValue(Key key, Img defaultValue)
Returns a value (image) 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 <T extends Key>
TgetValue(Key key, T[] enumValues, T defaultValue)
Returns a value (key) in the embedded JavaScript object at specific property.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 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 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 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, 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 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 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 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 boolean
has(Key key)
Returns true if the embedded JavaScript object contains an element at specific property.protected boolean
has(Key... keys)
Returns true if the embedded JavaScript object contains an element at all properties.protected boolean
isType(Key key, ObjectType... types)
Returnstrue
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 fromorg.pepstock.charba.client
package.protected void
remove(Key key)
Removes an element (by key) from the embedded JavaScript object.protected void
remove(Key... keys)
Removes a set of elements (by keys) 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>
voidsetArrayValue(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, boolean value)
Sets a value (boolean) 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, int value)
Sets a value (int) in the embedded JavaScript object at specific property.protected void
setValue(Key key, String value)
Sets a value (string) 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, NativeCallback value)
Sets a value (native callback function) 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, CallbackProxy.Proxy value)
Sets a value (callback proxy function) 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, 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, BaseNativeEvent value)
Sets a value (event) 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, Img value)
Sets a value (image) in the embedded JavaScript object at specific property.protected <T extends Key>
voidsetValue(Key key, T value)
Sets a value (EnumValue) in the embedded JavaScript object at specific property.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, 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, 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.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, 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, 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.String
toJSON()
Returns the string JSON representation of the object.protected ObjectType
type(Key key)
Returns the java script type of the property.
-
-
-
Constructor Detail
-
NativeObjectContainer
protected NativeObjectContainer()
Creates the object with an empty native object instance.
-
NativeObjectContainer
protected NativeObjectContainer(NativeObject nativeObject)
Creates the object with native object instance to be wrapped.- Parameters:
nativeObject
- native object instance to be wrapped.
-
-
Method Detail
-
checkDefaultValuesArgument
protected final <T> T checkDefaultValuesArgument(T defaultValues)
Checks if the argument, which is assuming is a default values instance, is consistent.
If not, throwsIllegalArgumentException
.- Type Parameters:
T
- type of default argument- Parameters:
defaultValues
- default values instance to check- Returns:
- the same instance passed as argument
-
getNativeObject
protected final NativeObject getNativeObject()
Returns the native object instance.- Returns:
- the native object instance.
-
loadNativeObject
public final ChartEnvelop<NativeObject> loadNativeObject(ChartEnvelop<NativeObject> envelop)
Returns the native object instance inside an envelop.
It can be called only fromorg.pepstock.charba.client
package.- Parameters:
envelop
- envelop instance which will contain the native object- Returns:
- the envelop, passed as argument, loaded with the native object
-
toJSON
public final String toJSON()
Returns the string JSON representation of the object.- Returns:
- the string JSON representation of the object.
-
empty
protected final boolean empty()
Returnstrue
if there is at least a property, otherwisefalse
.- Returns:
true
if there is at least a property, otherwisefalse
.
-
has
protected final boolean has(Key key)
Returns true if the embedded JavaScript object contains an element at specific property.- Parameters:
key
- key of the property of JavaScript object.- Returns:
true
if the embedded JavaScript object contains an element at specific property
-
has
protected final boolean has(Key... keys)
Returns true if the embedded JavaScript object contains an element at all properties.- Parameters:
keys
- set of keys of the properties of JavaScript object.- Returns:
true
if the embedded JavaScript object contains an element at all properties.
-
keys
protected final List<Key> keys()
Returns the list of properties names of the object.- Returns:
- the list of properties names of the object.
-
type
protected final ObjectType type(Key key)
Returns the java script type of the property.- Parameters:
key
- name of the java script property.- Returns:
- the java script type of the property.
-
isType
protected final boolean isType(Key key, ObjectType... types)
Returnstrue
if the type of the property is equals to one of the object types passed as argument.- Parameters:
key
- name of the java script property.types
- types to check against the type of the property.- Returns:
- the java script type of the property.
-
remove
protected final void remove(Key key)
Removes an element (by key) from the embedded JavaScript object.- Parameters:
key
- key of the property of JavaScript object.
-
remove
protected final void remove(Key... keys)
Removes a set of elements (by keys) from the embedded JavaScript object.- Parameters:
keys
- set of keys of the properties of JavaScript object.
-
setValue
protected final void setValue(Key key, int value)
Sets a value (int) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
getValue
protected final int getValue(Key key, int defaultValue)
Returns a value (int) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missing- Returns:
- value of the property
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- values of integers to be set
-
getValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single number value- Returns:
- value of the property (by array)
-
setValue
protected final void setValue(Key key, double value)
Sets a value (double) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
getValue
protected final double getValue(Key key, double defaultValue)
Returns a value (double) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missing- Returns:
- value of the property
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- values of doubles to be set
-
getValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single number value- Returns:
- value of the property (by array)
-
setValue
protected final void setValue(Key key, boolean value)
Sets a value (boolean) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
getValue
protected final boolean getValue(Key key, boolean defaultValue)
Returns a value (boolean) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missing- Returns:
- value of the property
-
getValue
protected final String getValue(Key key, String defaultValue)
Returns a value (string) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missing- Returns:
- value of the property
-
setValue
protected final void setValue(Key key, String value)
Sets a value (string) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- values of strings to be set
-
getValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single string value- Returns:
- value of the property (by array)
-
getValue
protected final Date getValue(Key key, Date defaultValue)
Returns a value (date) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missing- Returns:
- value of the property
-
setValue
protected final void setValue(Key key, Date value)
Sets a value (date) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
getValue
protected final NativeObject getValue(Key key)
Returns a value (JavaScript Object) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.- Returns:
- value of the property or
null
if not there
-
setValue
protected final void setValue(Key key, NativeObject value)
Sets a value (JavaScript Object) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setEmptyValue
protected final void setEmptyValue(Key key)
Sets a value (an empty JavaScript Object) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.
-
setValue
protected final void setValue(Key key, NativeObjectContainer value)
Sets a value (JavaScript Object) in the embedded JavaScript object at specific property by object container.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- native object containers to be set
-
setArrayValue
protected final void setArrayValue(Key key, ArrayObjectContainerList<?> container)
Sets a value (Array from a container list) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.container
- container of array
-
setValue
protected final void setValue(Key key, NativeArrayContainer<?> value)
Sets a value (JavaScript Object) in the embedded JavaScript object at specific property by array container.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setArrayValue
protected final void setArrayValue(Key key, ArrayDoubleArrayList<?> container)
Sets a value (Array from a double array container list) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.container
- container of array of doubles
-
setValue
protected final void setValue(Key key, CallbackProxy.Proxy value)
Sets a value (callback proxy function) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setValue
protected final void setValue(Key key, NativeCallback value)
Sets a value (native callback function) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
getValue
protected final Canvas getValue(Key key, Canvas defaultValue)
Returns a value (canvas) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missing- Returns:
- value of the property
-
setValue
protected final void setValue(Key key, Canvas value)
Sets a value (canvas) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- images to be set
-
getValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single canvas value- Returns:
- value of the property (by array)
-
getValue
protected final Img getValue(Key key, Img defaultValue)
Returns a value (image) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missing- Returns:
- value of the property
-
setValue
protected final void setValue(Key key, Img value)
Sets a value (image) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- images to be set
-
getValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single image value- Returns:
- value of the property (by array)
-
getValue
protected final CanvasGradientItem getValue(Key key, CanvasGradientItem defaultValue)
Returns a value (gradient) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missing- Returns:
- value of the property
-
setValue
protected final void setValue(Key key, CanvasGradientItem value)
Sets a value (gradient) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- gradients to be set
-
getValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single gradient value- Returns:
- value of the property (by array) or an empty array if not exist
-
getValue
protected final CanvasPatternItem getValue(Key key, CanvasPatternItem defaultValue)
Returns a value (pattern) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the property is missing- Returns:
- value of the property
-
setValue
protected final void setValue(Key key, CanvasPatternItem value)
Sets a value (pattern) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- patterns to be set
-
getValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single pattern value- Returns:
- value of the property (by array)
-
getValue
protected final String getValue(Key key, Key defaultValue)
Returns a value (string) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value as key if the property is missing- Returns:
- value of the property
-
setValue
protected final <T extends Key> void setValue(Key key, T value)
Sets a value (EnumValue) in the embedded JavaScript object at specific property.- Type Parameters:
T
- type of key- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
getValue
protected final ScaleId getValue(Key key, ScaleId defaultValue)
Returns a value (ScaleId) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value as key if the property is missing- Returns:
- value of the property
-
getValue
protected final <T extends Key> T getValue(Key key, T[] enumValues, T defaultValue)
Returns a value (key) in the embedded JavaScript object at specific property.- Type Parameters:
T
- type of key- Parameters:
key
- key of the property of JavaScript object.enumValues
- all enumeration valuesdefaultValue
- default value if the property is missing- Returns:
- value of the property
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- value of keys to be set
-
getValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.defaultValue
- default value if the value was stored as single key value- Returns:
- value of the property (by array) or
null
if not exist
-
getArrayValue
protected final <T extends Array> T getArrayValue(Key key)
Returns a value (array) in the embedded JavaScript object at specific property.- Type Parameters:
T
- type of array- Parameters:
key
- key of the property of JavaScript object.- Returns:
- value of the property or
null
if not exist
-
setArrayValue
protected final <T extends Array> void setArrayValue(Key key, T value)
Sets a value (Array) in the embedded JavaScript object at specific property.- Type Parameters:
T
- type of array- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
setValueOrArray
protected final 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.- Parameters:
key
- key of the property of JavaScript object.values
- values of colors to be set
-
setValue
protected final void setValue(Key key, Chart value)
Sets a value (chart) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
getNativeChart
protected final Chart getNativeChart(Key key)
Returns a value (chart) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.- Returns:
- value of the property
-
setElement
protected final void setElement(Key key, BaseHtmlElement value)
Sets a value (BaseHtmlElement) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
getElement
protected final BaseHtmlElement getElement(Key key)
Returns a value (BaseHtmlElement) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.- Returns:
- value of the property
-
setValue
protected final void setValue(Key key, BaseNativeEvent value)
Sets a value (event) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.value
- value to be set
-
getNativeEvent
protected final BaseNativeEvent getNativeEvent(Key key)
Returns a value (native event) in the embedded JavaScript object at specific property.- Parameters:
key
- key of the property of JavaScript object.- Returns:
- value of the property
-
getValueForMultipleKeyTypes
protected final String getValueForMultipleKeyTypes(Key key, String defaultsValue)
Returns the value of a property checking if the type of current value is a STRING.- Parameters:
key
- key of the property of JavaScript objectdefaultsValue
- default value if the value was stored as single key value- Returns:
- value of the property
-
getValueForMultipleKeyTypes
protected final double getValueForMultipleKeyTypes(Key key, double defaultsValue)
Returns the value of a property checking if the type of current value is a NUMBER.- Parameters:
key
- key of the property of JavaScript objectdefaultsValue
- default value if the value was stored as single key value- Returns:
- value of the property
-
getValueForMultipleKeyTypes
protected final 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).- Parameters:
key
- key of the property of JavaScript objectdefaultsValue
- default value if the value was stored as single key value- Returns:
- value of the property
-
setNewIncrementalId
protected final void setNewIncrementalId()
Stores new incremental id if not previously stored.
-
setNewIncrementalId
protected final void setNewIncrementalId(String prefix)
Stores new incremental id if not previously stored.- Parameters:
prefix
- prefix to add to the value of incremental id.
-
getIncrementalId
protected final String getIncrementalId()
Returns the incremental id of the object.- Returns:
- the incremental id of the object.
-
-