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, setAttributesassociateValue, 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.Exceptionpublic static ScriptObject createJsDyWrapper(java.lang.Object value) throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Class<?> getNativeClass()
public java.lang.String getClassName()
ScriptableObjectgetClassName 在接口中 org.mozilla.javascript.ScriptablegetClassName 在类中 KObjectpublic 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.IdFunctionCallexecIdCall 在类中 org.mozilla.javascript.IdScriptableObjectpublic java.lang.Object unwrap()
unwrap 在接口中 ScriptWrapper<java.lang.Object>public java.lang.Object getDefaultValue(java.lang.Class<?> typeHint)
ScriptableObjectNote 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.ScriptablegetDefaultValue 在类中 KObjecttypeHint - the type hintpublic void __release()
ScriptObject__release 在接口中 ScriptObject__release 在类中 KObjectpublic 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.Scriptableget 在类中 ScriptableObjectindex - start - the object in which the lookup beganpublic java.lang.Object get(java.lang.String name,
org.mozilla.javascript.Scriptable start)
ScriptableObjectget 在接口中 org.mozilla.javascript.Scriptableget 在类中 org.mozilla.javascript.IdScriptableObjectname - the name of the propertystart - the object in which the lookup beganpublic boolean has(int index,
org.mozilla.javascript.Scriptable start)
ScriptableObjecthas 在接口中 org.mozilla.javascript.Scriptablehas 在类中 ScriptableObjectindex - the numeric index for the propertystart - the object in which the lookup beganpublic boolean has(java.lang.String name,
org.mozilla.javascript.Scriptable start)
ScriptableObjecthas 在接口中 org.mozilla.javascript.Scriptablehas 在类中 org.mozilla.javascript.IdScriptableObjectname - the name of the propertystart - the object in which the lookup beganpublic void delete(int index)
ScriptableObjectdelete 在接口中 org.mozilla.javascript.Scriptabledelete 在类中 ScriptableObjectindex - the numeric index for the propertypublic void delete(java.lang.String name)
ScriptableObjectdelete 在接口中 org.mozilla.javascript.Scriptabledelete 在类中 org.mozilla.javascript.IdScriptableObjectname - the name of the property