org.mozilla.javascript.jdk15.VMBridge_jdk15 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rhino Show documentation
Show all versions of rhino Show documentation
Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically
embedded into Java applications to provide scripting to end users.
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.javascript.jdk15;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Iterator;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import org.mozilla.javascript.*;
public class VMBridge_jdk15 extends VMBridge
{
public VMBridge_jdk15() throws SecurityException, InstantiationException {
try {
// Just try and see if we can access the isVarArgs method.
// We want to fail loading if the method does not exist
// so that we can load a bridge to an older JDK instead.
Method.class.getMethod("isVarArgs", (Class[]) null);
} catch (NoSuchMethodException e) {
// Throw a fitting exception that is handled by
// org.mozilla.javascript.Kit.newInstanceOrNull:
throw new InstantiationException(e.getMessage());
}
}
private ThreadLocal
© 2015 - 2024 Weber Informatics LLC | Privacy Policy