< prev index next >

modules/javafx.web/src/ios/java/javafx/scene/web/ExportedJavaObject.java

Print this page


   1 /*
   2  * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.scene.web;
  27 
  28 import java.lang.reflect.InvocationTargetException;
  29 import java.lang.reflect.Method;
  30 import java.lang.reflect.Modifier;
  31 import java.lang.reflect.UndeclaredThrowableException;
  32 import java.math.BigDecimal;
  33 import java.math.BigInteger;
  34 import java.util.ArrayList;
  35 import java.util.Collections;
  36 import java.util.List;
  37 
  38 import java.security.AccessController;
  39 import java.security.PrivilegedAction;
  40 import java.security.PrivilegedExceptionAction;
  41 
  42 import sun.reflect.misc.MethodUtil;
  43 import sun.reflect.misc.ReflectUtil;
  44 
  45 
  46 // Java Object exported to JavaScript
  47 class ExportedJavaObject {
  48 
  49     private final JS2JavaBridge owner;
  50     private final String objId; // id to call
  51     private final Object javaObject;
  52     private final Class cls;
  53     private Method[] methods;
  54     private List<String> jsNames = new ArrayList<String>(1);
  55 
  56     private JS2JavaBridge getJSBridge() {
  57         return owner;
  58     }
  59 
  60     public ExportedJavaObject(JS2JavaBridge owner, String objId, Object javaObject) {
  61         this.owner = owner;
  62         this.objId = objId;
  63         this.javaObject = javaObject;


   1 /*
   2  * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javafx.scene.web;
  27 
  28 import java.lang.reflect.InvocationTargetException;
  29 import java.lang.reflect.Method;
  30 import java.lang.reflect.Modifier;
  31 import java.lang.reflect.UndeclaredThrowableException;
  32 import java.math.BigDecimal;
  33 import java.math.BigInteger;
  34 import java.util.ArrayList;
  35 import java.util.Collections;
  36 import java.util.List;
  37 
  38 import java.security.AccessController;
  39 import java.security.PrivilegedAction;
  40 import java.security.PrivilegedExceptionAction;
  41 
  42 import com.sun.javafx.reflect.ReflectUtil;

  43 
  44 
  45 // Java Object exported to JavaScript
  46 class ExportedJavaObject {
  47 
  48     private final JS2JavaBridge owner;
  49     private final String objId; // id to call
  50     private final Object javaObject;
  51     private final Class cls;
  52     private Method[] methods;
  53     private List<String> jsNames = new ArrayList<String>(1);
  54 
  55     private JS2JavaBridge getJSBridge() {
  56         return owner;
  57     }
  58 
  59     public ExportedJavaObject(JS2JavaBridge owner, String objId, Object javaObject) {
  60         this.owner = owner;
  61         this.objId = objId;
  62         this.javaObject = javaObject;


< prev index next >