P
- parent node classD
- defaults provider classpublic abstract class AbstractModel<P extends AbstractModel<?,?>,D> extends NativeObjectContainer
Modifier | Constructor and Description |
---|---|
protected |
AbstractModel(D defaultValues)
Creates the object with default provider.
This is the root of elements tree and new native object is created. |
protected |
AbstractModel(D defaultValues,
NativeObject nativeObject)
Creates the object with default provider and the native object.
This is the root of elements tree . |
protected |
AbstractModel(P parent,
Key childKey,
D defaultValues)
Creates the object with parent element, the key of this element and default values.
The native object to map java script properties will be created empty. |
protected |
AbstractModel(P parent,
Key childKey,
D defaultValues,
NativeObject nativeObject)
Creates the object with the parent, the key of this element, default values and native object to map java script
properties.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkAndAddToParent()
Called recursively when a property has been set in the item.
This is mandatory because it could happen that the parent item is not present, therefore it must be added. |
protected Key |
getChildKey()
Returns the property name to use to add this element to its parent.
|
protected D |
getDefaultValues()
Returns the default provider instance.
|
protected P |
getParent()
Returns the parent element.
|
protected void |
setCallbackToModel(AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
Adds a proxy function (for callbacks) to a model at the specific key.
|
protected void |
setEventToModel(AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
Adds a proxy function (for events) to a model at the specific key.
|
getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, keys, remove, remove, removeIfExists, setArrayValue, setArrayValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
protected AbstractModel(D defaultValues)
defaultValues
- default providerprotected AbstractModel(P parent, Key childKey, D defaultValues)
parent
- parent node to use to add this element where changedchildKey
- the property name of this element to use to add it to the parent.defaultValues
- default providerprotected AbstractModel(D defaultValues, NativeObject nativeObject)
defaultValues
- default providernativeObject
- native object to map java script propertiesprotected AbstractModel(P parent, Key childKey, D defaultValues, NativeObject nativeObject)
parent
- parent node to use to add this element where changedchildKey
- the property name of this element to use to add it to the parent.defaultValues
- default providernativeObject
- native object to map java script propertiesprotected final Key getChildKey()
null
if is a root element.protected final P getParent()
null
if is a root element.protected final D getDefaultValues()
protected final void setEventToModel(AbstractModel<?,?> model, Key key, CallbackProxy.Proxy proxy)
model
- element where adding the function proxykey
- property name to use to add the function proxyproxy
- the function proxy instance to addprotected final void setCallbackToModel(AbstractModel<?,?> model, Key key, CallbackProxy.Proxy proxy)
model
- element where adding the function proxykey
- property name to use to add the function proxyproxy
- the function proxy instance to addprotected final void checkAndAddToParent()