本文整理汇总了Java中jdk.internal.dynalink.beans.StaticClass.forClass方法的典型用法代码示例。如果您正苦于以下问题:Java StaticClass.forClass方法的具体用法?Java StaticClass.forClass怎么用?Java StaticClass.forClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.internal.dynalink.beans.StaticClass
的用法示例。
在下文中一共展示了StaticClass.forClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createProperty
import jdk.internal.dynalink.beans.StaticClass; //导入方法依赖的package包/类
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;
}
示例2: createProperty
import jdk.internal.dynalink.beans.StaticClass; //导入方法依赖的package包/类
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;
}
示例3: type
import jdk.internal.dynalink.beans.StaticClass; //导入方法依赖的package包/类
private static StaticClass type(final Object objTypeName) throws ClassNotFoundException {
return StaticClass.forClass(type(JSType.toString(objTypeName)));
}
示例4: getInternalRunnableType
import jdk.internal.dynalink.beans.StaticClass; //导入方法依赖的package包/类
public static StaticClass getInternalRunnableType() {
return StaticClass.forClass(InternalRunnable.class);
}