Java 类jdk.nashorn.internal.runtime.NativeJavaPackage 实例源码

项目:OpenJSharp    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            final Context context = Global.instance().getContext();
            try {
                return StaticClass.forClass(context.findClass(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:openjdk-jdk10    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            final Context context = Global.instance().getContext();
            try {
                return StaticClass.forClass(context.findClass(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:openjdk9    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            final Context context = Global.instance().getContext();
            try {
                return StaticClass.forClass(context.findClass(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:kaziranga    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            final Context context = Global.instance().getContext();
            try {
                return StaticClass.forClass(context.findClass(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:lookaside_java-1.8.0-openjdk    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            final Context context = Global.instance().getContext();
            try {
                return StaticClass.forClass(context.findClass(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:jdk8u_nashorn    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            final Context context = Global.instance().getContext();
            try {
                return StaticClass.forClass(context.findClass(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:infobip-open-jdk-8    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            final Context context = Global.instance().getContext();
            try {
                return StaticClass.forClass(context.findClass(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:OLD-OpenJDK8    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            final Context context = Global.instance().getContext();
            try {
                return StaticClass.forClass(context.findClass(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:nashorn-backport    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            try {
                return StaticClass.forClass(Class.forName(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:nashorn    文件:NativeJavaImporter.java   
private Object createProperty(final String name) {
    final int len = args.length;

    for (int i = len - 1; i > -1; i--) {
        final Object obj = args[i];

        if (obj instanceof StaticClass) {
            if (((StaticClass)obj).getRepresentedClass().getSimpleName().equals(name)) {
                return obj;
            }
        } else if (obj instanceof NativeJavaPackage) {
            final String pkgName  = ((NativeJavaPackage)obj).getName();
            final String fullName = pkgName.isEmpty() ? name : (pkgName + "." + name);
            try {
                return StaticClass.forClass(Class.forName(fullName));
            } catch (final ClassNotFoundException e) {
                // IGNORE
            }
        }
    }
    return null;
}
项目:OpenJSharp    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
    this.builtinJavaImporter = initConstructor("JavaImporter", ScriptFunction.class);
    this.builtinJavaApi = initConstructor("Java", ScriptObject.class);
}
项目:openjdk-jdk10    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
}
项目:openjdk9    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
}
项目:kaziranga    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
}
项目:lookaside_java-1.8.0-openjdk    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
}
项目:jdk8u_nashorn    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
}
项目:infobip-open-jdk-8    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
    this.builtinJavaImporter = initConstructor("JavaImporter", ScriptFunction.class);
    this.builtinJavaApi = initConstructor("Java", ScriptObject.class);
}
项目:OLD-OpenJDK8    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
    this.builtinJavaImporter = initConstructor("JavaImporter");
    this.builtinJavaApi = initConstructor("Java");
}
项目:nashorn-backport    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
    this.builtinJavaImporter = initConstructor("JavaImporter");
    this.builtinJavaApi = initConstructor("Java");
}
项目:nashorn    文件:Global.java   
private void initJavaAccess() {
    final ScriptObject objectProto = getObjectPrototype();
    this.builtinPackages = new NativeJavaPackage("", objectProto);
    this.builtinCom = new NativeJavaPackage("com", objectProto);
    this.builtinEdu = new NativeJavaPackage("edu", objectProto);
    this.builtinJava = new NativeJavaPackage("java", objectProto);
    this.builtinJavafx = new NativeJavaPackage("javafx", objectProto);
    this.builtinJavax = new NativeJavaPackage("javax", objectProto);
    this.builtinOrg = new NativeJavaPackage("org", objectProto);
    this.builtinJavaImporter = initConstructor("JavaImporter");
    this.builtinJavaApi = initConstructor("Java");
}