kd.bos.script.jsengine.def

## 类 KDyWrapper

- java.lang.Object
- - org.mozilla.javascript.ScriptableObject
  - - org.mozilla.javascript.IdScriptableObject
    - - kd.bos.script.jsengine.def.KObject
      - - kd.bos.script.jsengine.def.KDyWrapper

- 所有已实现的接口:
    java.io.Serializable, ScriptObject, ScriptWrapper<java.lang.Object>, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.IdFunctionCall, org.mozilla.javascript.Scriptable

      public class KDyWrapper
      extends KObject
      implements ScriptWrapper<java.lang.Object>

  动态封装类。
  另请参阅:
    序列化表格

- - ### 字段概要

    - ### 从类继承的字段 org.mozilla.javascript.ScriptableObject

      `CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST`

    - ### 从接口继承的字段 org.mozilla.javascript.Scriptable

      `NOT_FOUND`

  - ### 构造器概要

    构造器
    构造器和说明
    `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()`

    - ### 从类继承的方法 org.mozilla.javascript.IdScriptableObject

      `activatePrototypeMap, defineOwnProperty, exportAsJSClass, getAttributes, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, put, setAttributes`

    - ### 从类继承的方法 org.mozilla.javascript.ScriptableObject

      `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`

    - ### 从类继承的方法 java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### 从接口继承的方法 kd.bos.script.ScriptObject

      `__getUndefinedProperty`

- - ### 构造器详细资料

    - #### KDyWrapper

          @JSConstructor
          public KDyWrapper()

      定义原型(define class)需要的构造函数(空参数)
      另请参阅:
        `KDyDefine.ensureExported(java.lang.String, java.lang.Class<?>, java.lang.Class<org.mozilla.javascript.Scriptable>, org.mozilla.javascript.Scriptable)`

    - #### KDyWrapper

          public KDyWrapper(java.lang.Object beanObj,
                            java.lang.Class<?> beanCls)

      创建代理类

  - ### 方法详细资料

    - #### createJavaDyWrapper

          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`

    - #### createJsDyWrapper

          public static ScriptObject createJsDyWrapper(java.lang.Object value)
                                                throws java.lang.Exception

      抛出:
        `java.lang.Exception`

    - #### getNativeClass

          public java.lang.Class<?> getNativeClass()

      以下是三个方法将被字节码拦截，不可声明为final（否则拦截失败）。@see KDyDefine.genSubClass
      返回:

    - #### getClassName

          public java.lang.String getClassName()

      从类复制的说明: `ScriptableObject`
      Return the name of the class. This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
      指定者:
        `getClassName` 在接口中 `org.mozilla.javascript.Scriptable`
      覆盖:
        `getClassName` 在类中 `KObject`

    - #### getNamespace

          public java.lang.String getNamespace()

    - #### execIdCall

          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`

    - #### unwrap

          public java.lang.Object unwrap()

      指定者:
        `unwrap` 在接口中 `ScriptWrapper<java.lang.Object>`

    - #### getDefaultValue

          public java.lang.Object getDefaultValue(java.lang.Class<?> typeHint)

      从类复制的说明: `ScriptableObject`
      Implements the [[DefaultValue]] internal method.

      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 hint
      返回:
        the default value for the object See ECMA 8.6.2.6.

    - #### __release

          public void __release()

      从接口复制的说明: `ScriptObject`
      释放本对象资源，子类实现。
      指定者:
        `__release` 在接口中 `ScriptObject`
      覆盖:
        `__release` 在类中 `KObject`

    - #### __getFunctionMap

          public java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> __getFunctionMap()

    - #### toString

          public java.lang.String toString()

      覆盖:
        `toString` 在类中 `KObject`

    - #### get

          public java.lang.Object get(int index,
                                      org.mozilla.javascript.Scriptable start)

      以下融合functionMap/idMap，用于获取对象属性或函数。 super优先： new Xxx({...}), {...}里的方法将编译为InterpretedFunction，应覆盖Xxx中的KSMethod方法，故super应优先。
      指定者:
        `get` 在接口中 `org.mozilla.javascript.Scriptable`
      覆盖:
        `get` 在类中 `ScriptableObject`
      参数:
        `index` -
        `start` - the object in which the lookup began
      返回:
        the value of the property (may be null), or NOT_FOUND

    - #### get

          public java.lang.Object get(java.lang.String name,
                                      org.mozilla.javascript.Scriptable start)

      从类复制的说明: `ScriptableObject`
      Returns the value of the named property or NOT_FOUND. If the property was created using defineProperty, the appropriate getter method is called.
      指定者:
        `get` 在接口中 `org.mozilla.javascript.Scriptable`
      覆盖:
        `get` 在类中 `org.mozilla.javascript.IdScriptableObject`
      参数:
        `name` - the name of the property
        `start` - the object in which the lookup began
      返回:
        the value of the property (may be null), or NOT_FOUND

    - #### has

          public boolean has(int index,
                             org.mozilla.javascript.Scriptable start)

      从类复制的说明: `ScriptableObject`
      Returns true if the property index is defined.
      指定者:
        `has` 在接口中 `org.mozilla.javascript.Scriptable`
      覆盖:
        `has` 在类中 `ScriptableObject`
      参数:
        `index` - the numeric index for the property
        `start` - the object in which the lookup began
      返回:
        true if and only if the property was found in the object

    - #### has

          public boolean has(java.lang.String name,
                             org.mozilla.javascript.Scriptable start)

      从类复制的说明: `ScriptableObject`
      Returns true if the named property is defined.
      指定者:
        `has` 在接口中 `org.mozilla.javascript.Scriptable`
      覆盖:
        `has` 在类中 `org.mozilla.javascript.IdScriptableObject`
      参数:
        `name` - the name of the property
        `start` - the object in which the lookup began
      返回:
        true if and only if the property was found in the object

    - #### delete

          public void delete(int index)

      从类复制的说明: `ScriptableObject`
      Removes the indexed property from the object. If the property is not found, or it has the PERMANENT attribute, no action is taken.
      指定者:
        `delete` 在接口中 `org.mozilla.javascript.Scriptable`
      覆盖:
        `delete` 在类中 `ScriptableObject`
      参数:
        `index` - the numeric index for the property

    - #### delete

          public void delete(java.lang.String name)

      从类复制的说明: `ScriptableObject`
      Removes a named property from the object. If the property is not found, or it has the PERMANENT attribute, no action is taken.
      指定者:
        `delete` 在接口中 `org.mozilla.javascript.Scriptable`
      覆盖:
        `delete` 在类中 `org.mozilla.javascript.IdScriptableObject`
      参数:
        `name` - the name of the property