本文整理汇总了Java中jdk.nashorn.internal.lookup.MethodHandleFactory.LookupException方法的典型用法代码示例。如果您正苦于以下问题:Java MethodHandleFactory.LookupException方法的具体用法?Java MethodHandleFactory.LookupException怎么用?Java MethodHandleFactory.LookupException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.lookup.MethodHandleFactory
的用法示例。
在下文中一共展示了MethodHandleFactory.LookupException方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findOwnMH
import jdk.nashorn.internal.lookup.MethodHandleFactory; //导入方法依赖的package包/类
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
try {
return MH.findStatic(MethodHandles.lookup(), LinkerCallSite.class, name, MH.type(rtype, types));
} catch (final MethodHandleFactory.LookupException e) {
return MH.findVirtual(MethodHandles.lookup(), LinkerCallSite.class, name, MH.type(rtype, types));
}
}
示例2: findMH
import jdk.nashorn.internal.lookup.MethodHandleFactory; //导入方法依赖的package包/类
private static MethodHandle findMH(final String name, final Class<?> target, final Class<?> rtype, final Class<?>... types) {
final MethodType mt = MH.type(rtype, types);
try {
return MH.findStatic(MethodHandles.lookup(), target, name, mt);
} catch (final MethodHandleFactory.LookupException e) {
return MH.findVirtual(MethodHandles.lookup(), target, name, mt);
}
}
示例3: findOwnMH
import jdk.nashorn.internal.lookup.MethodHandleFactory; //导入方法依赖的package包/类
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
final Class<?> own = ScriptObject.class;
final MethodType mt = MH.type(rtype, types);
try {
return MH.findStatic(MethodHandles.lookup(), own, name, mt);
} catch (final MethodHandleFactory.LookupException e) {
return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
}
}
示例4: findOwnMH
import jdk.nashorn.internal.lookup.MethodHandleFactory; //导入方法依赖的package包/类
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
final Class<?> own = ScriptFunction.class;
final MethodType mt = MH.type(rtype, types);
try {
return MH.findStatic(MethodHandles.lookup(), own, name, mt);
} catch (final MethodHandleFactory.LookupException e) {
return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
}
}
示例5: findOwnMH
import jdk.nashorn.internal.lookup.MethodHandleFactory; //导入方法依赖的package包/类
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
try {
return MH.findStatic(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
} catch (final MethodHandleFactory.LookupException e) {
return MH.findVirtual(MethodHandles.lookup(), RuntimeCallSite.class, name, MH.type(rtype, types));
}
}
示例6: findOwnMH
import jdk.nashorn.internal.lookup.MethodHandleFactory; //导入方法依赖的package包/类
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
final Class<?> own = JSObjectLinker.class;
final MethodType mt = MH.type(rtype, types);
try {
return MH.findStatic(MethodHandles.lookup(), own, name, mt);
} catch (final MethodHandleFactory.LookupException e) {
return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
}
}
示例7: findJSObjectMH
import jdk.nashorn.internal.lookup.MethodHandleFactory; //导入方法依赖的package包/类
private static MethodHandle findJSObjectMH(final String name, final Class<?> rtype, final Class<?>... types) {
final Class<?> own = JSObject.class;
final MethodType mt = MH.type(rtype, types);
try {
return MH.findVirtual(MethodHandles.publicLookup(), own, name, mt);
} catch (final MethodHandleFactory.LookupException e) {
return MH.findVirtual(MethodHandles.lookup(), own, name, mt);
}
}