Beispiel #1
0
 public IokeObject createIntegratedJavaWrapper(Class clz) {
   IokeObject obj = this.javaWrapper.allocateCopy(null, null);
   obj.mimicsWithoutCheck(registry.wrap(Class.class));
   obj.mimicsWithoutCheck(registry.wrap(clz.getSuperclass()));
   for (Class<?> i : clz.getInterfaces()) {
     obj.mimicsWithoutCheck(registry.wrap(i));
   }
   obj.setData(JavaIntegrationWrapper.wrapWithMethods(clz, obj, this));
   return obj;
 }
Beispiel #2
0
  public IokeObject createJavaWrapper(Object object) {
    if (object instanceof Class) {
      if (object == Object.class) {
        IokeObject obj = this.javaWrapper.allocateCopy(null, null);
        obj.mimicsWithoutCheck(this.javaWrapper);
        obj.setData(JavaWrapper.wrapWithMethods((Class) object, obj, this));
        return obj;
      } else if (object == Class.class) {
        IokeObject obj = this.javaWrapper.allocateCopy(null, null);
        Class<?> clz = (Class) object;
        IokeObject objWrap = registry.wrap(clz.getSuperclass());
        obj.mimicsWithoutCheck(objWrap);
        obj.setData(JavaWrapper.wrapWithMethods(clz, obj, this));

        objWrap.mimicsWithoutCheck(0, obj); // circularity - warning! =)

        return obj;
      } else {
        IokeObject obj = this.javaWrapper.allocateCopy(null, null);
        Class<?> clz = (Class) object;
        if (((Class) object).isArray()) {
          obj.mimicsWithoutCheck(javaArray);
        }
        obj.mimicsWithoutCheck(registry.wrap(Class.class));
        obj.mimicsWithoutCheck(registry.wrap(clz.getSuperclass()));
        for (Class<?> i : clz.getInterfaces()) {
          obj.mimicsWithoutCheck(registry.wrap(i));
        }
        obj.setData(JavaWrapper.wrapWithMethods(clz, obj, this));
        return obj;
      }
    } else {
      IokeObject obj = this.javaWrapper.allocateCopy(null, null);
      obj.mimicsWithoutCheck(registry.wrap(object.getClass()));
      obj.setData(new JavaWrapper(object));
      return obj;
    }
  }