public class Setters
extends org.mozilla.javascript.BaseFunction
this.function(name, newValue, oldValue, exception)
this is set to the object whose field changed value
name is the name of the field that changed value
newValue is the new value of the field
oldValue was the value of the field before the assignment
exception is non-null when a value is being reverted
The new value is assigned to the field before the setter is called.
So, newValue is not strictly needed; it can also be obtained by simply
reading the value of the field associated with the setter.
Following normal JavaScript conventions, unneeded arguments can be
omitted from the declaration. So all of the following are valid
declarations for a setter function:
function(name, newValue, oldValue) {}
function(name, newValue) {}
function(name) {}
function() {}
| Constructor and Description |
|---|
Setters(java.lang.Object member) |
| Modifier and Type | Method and Description |
|---|---|
static void |
addGlobal(org.mozilla.javascript.Callable setter)
Add a setter that is called when any field changes value.
|
java.lang.Object |
call(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] args)
The master setter function called by XDCscript.
|
static int |
getMaxStackDepth()
Get the maximum allowed depth of recursively nested setters.
|
static java.util.Set<org.mozilla.javascript.Callable> |
init(xdc.services.intern.xsr.Value.Observable obj,
int index) |
static java.util.Set<org.mozilla.javascript.Callable> |
init(xdc.services.intern.xsr.Value.Observable obj,
java.lang.String name)
Add setter support to a field of an object.
|
static void |
setMaxStackDepth(int maxStackDepth)
Set the maximum allowed depth of recursively nested setters, as
a debugging aid.
|
construct, createObject, execIdCall, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, getArity, getClassName, getClassPrototype, getFunctionName, getInstanceIdName, getInstanceIdValue, getLength, getMaxInstanceId, getPrototypeProperty, getTypeOf, hasInstance, hasPrototypeProperty, initPrototypeId, setImmunePrototypeProperty, setInstanceIdValueactivatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, defineOwnProperty, delete, exportAsJSClass, get, getAttributes, getOwnPropertyDescriptor, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, put, setAttributes, setInstanceIdAttributesapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, sizepublic static java.util.Set<org.mozilla.javascript.Callable> init(xdc.services.intern.xsr.Value.Observable obj,
java.lang.String name)
public static java.util.Set<org.mozilla.javascript.Callable> init(xdc.services.intern.xsr.Value.Observable obj,
int index)
public java.lang.Object call(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] args)
call in interface org.mozilla.javascript.Callablecall in interface org.mozilla.javascript.Functioncall in class org.mozilla.javascript.BaseFunctionpublic static void addGlobal(org.mozilla.javascript.Callable setter)
public static int getMaxStackDepth()
public static void setMaxStackDepth(int maxStackDepth)