public class KDyWrapper extends KObject implements ScriptWrapper<java.lang.Object>
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
构造器和说明 |
---|
KDyWrapper()
定义原型(define class)需要的构造函数(空参数)
|
KDyWrapper(java.lang.Object beanObj,
java.lang.Class<?> beanCls)
创建代理类
|
限定符和类型 | 方法和说明 |
---|---|
java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> |
__getFunctionMap() |
void |
__release()
释放本对象资源,子类实现。
|
static KDyWrapper |
createJavaDyWrapper(java.lang.Class<? extends KDyWrapper> dyWrapperSubCls,
java.lang.Object beanObject,
java.lang.Class<?> beanCls) |
static ScriptObject |
createJsDyWrapper(java.lang.Object value) |
void |
delete(int index)
Removes the indexed property from the object.
|
void |
delete(java.lang.String name)
Removes a named property from the object.
|
java.lang.Object |
execIdCall(org.mozilla.javascript.IdFunctionObject f,
Context cx,
org.mozilla.javascript.Scriptable scope,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] args)
动态反射
|
java.lang.Object |
get(int index,
org.mozilla.javascript.Scriptable start)
以下融合functionMap/idMap,用于获取对象属性或函数。
|
java.lang.Object |
get(java.lang.String name,
org.mozilla.javascript.Scriptable start)
Returns the value of the named property or NOT_FOUND.
|
java.lang.String |
getClassName()
Return the name of the class.
|
java.lang.Object |
getDefaultValue(java.lang.Class<?> typeHint)
Implements the [[DefaultValue]] internal method.
|
java.lang.String |
getNamespace() |
java.lang.Class<?> |
getNativeClass()
以下是三个方法将被字节码拦截,不可声明为final(否则拦截失败)。
|
boolean |
has(int index,
org.mozilla.javascript.Scriptable start)
Returns true if the property index is defined.
|
boolean |
has(java.lang.String name,
org.mozilla.javascript.Scriptable start)
Returns true if the named property is defined.
|
java.lang.String |
toString() |
java.lang.Object |
unwrap() |
activatePrototypeMap, defineOwnProperty, exportAsJSClass, getAttributes, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, put, setAttributes
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineProperty, defineProperty, defineProperty, defineProperty, deleteProperty, deleteProperty, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasInstance, hasProperty, hasProperty, isConst, isEmpty, isExtensible, isSealed, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
__getUndefinedProperty
@JSConstructor public KDyWrapper()
public KDyWrapper(java.lang.Object beanObj, java.lang.Class<?> beanCls)
public static KDyWrapper createJavaDyWrapper(java.lang.Class<? extends KDyWrapper> dyWrapperSubCls, java.lang.Object beanObject, java.lang.Class<?> beanCls) throws java.lang.Exception
java.lang.Exception
public static ScriptObject createJsDyWrapper(java.lang.Object value) throws java.lang.Exception
java.lang.Exception
public java.lang.Class<?> getNativeClass()
public java.lang.String getClassName()
ScriptableObject
getClassName
在接口中 org.mozilla.javascript.Scriptable
getClassName
在类中 KObject
public java.lang.String getNamespace()
public java.lang.Object execIdCall(org.mozilla.javascript.IdFunctionObject f, Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args)
execIdCall
在接口中 org.mozilla.javascript.IdFunctionCall
execIdCall
在类中 org.mozilla.javascript.IdScriptableObject
public java.lang.Object unwrap()
unwrap
在接口中 ScriptWrapper<java.lang.Object>
public java.lang.Object getDefaultValue(java.lang.Class<?> typeHint)
ScriptableObject
Note that the toPrimitive conversion is a no-op for every type other than Object, for which [[DefaultValue]] is called. See ECMA 9.1.
A hint
of null means "no hint".
getDefaultValue
在接口中 org.mozilla.javascript.Scriptable
getDefaultValue
在类中 KObject
typeHint
- the type hintpublic void __release()
ScriptObject
__release
在接口中 ScriptObject
__release
在类中 KObject
public java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> __getFunctionMap()
public java.lang.Object get(int index, org.mozilla.javascript.Scriptable start)
get
在接口中 org.mozilla.javascript.Scriptable
get
在类中 ScriptableObject
index
- start
- the object in which the lookup beganpublic java.lang.Object get(java.lang.String name, org.mozilla.javascript.Scriptable start)
ScriptableObject
get
在接口中 org.mozilla.javascript.Scriptable
get
在类中 org.mozilla.javascript.IdScriptableObject
name
- the name of the propertystart
- the object in which the lookup beganpublic boolean has(int index, org.mozilla.javascript.Scriptable start)
ScriptableObject
has
在接口中 org.mozilla.javascript.Scriptable
has
在类中 ScriptableObject
index
- the numeric index for the propertystart
- the object in which the lookup beganpublic boolean has(java.lang.String name, org.mozilla.javascript.Scriptable start)
ScriptableObject
has
在接口中 org.mozilla.javascript.Scriptable
has
在类中 org.mozilla.javascript.IdScriptableObject
name
- the name of the propertystart
- the object in which the lookup beganpublic void delete(int index)
ScriptableObject
delete
在接口中 org.mozilla.javascript.Scriptable
delete
在类中 ScriptableObject
index
- the numeric index for the propertypublic void delete(java.lang.String name)
ScriptableObject
delete
在接口中 org.mozilla.javascript.Scriptable
delete
在类中 org.mozilla.javascript.IdScriptableObject
name
- the name of the property