本文整理汇总了Java中com.intellij.util.ReflectionUtil.getClassPublicMethods方法的典型用法代码示例。如果您正苦于以下问题:Java ReflectionUtil.getClassPublicMethods方法的具体用法?Java ReflectionUtil.getClassPublicMethods怎么用?Java ReflectionUtil.getClassPublicMethods使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.ReflectionUtil
的用法示例。
在下文中一共展示了ReflectionUtil.getClassPublicMethods方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VisitorDescription
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
public VisitorDescription(final Class<? extends DomElementVisitor> visitorClass) {
myVisitorClass = visitorClass;
for (final Method method : ReflectionUtil.getClassPublicMethods(visitorClass)) {
final Class<?>[] parameterTypes = method.getParameterTypes();
if (parameterTypes.length != 1) {
continue;
}
final Class<?> domClass = parameterTypes[0];
if (!ReflectionUtil.isAssignable(DomElement.class, domClass)) {
continue;
}
final String methodName = method.getName();
if (VISIT.equals(methodName) || methodName.startsWith(VISIT) /*&& domClass.getSimpleName().equals(methodName.substring(VISIT.length()))*/) {
method.setAccessible(true);
myMethods.put(domClass, method);
}
}
}
示例2: getPrimaryKeyMethod
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Nullable
private static Method getPrimaryKeyMethod(final Class<?> aClass) {
Method method = ourPrimaryKeyMethods.get(aClass);
if (method == null) {
if (ourPrimaryKeyMethods.containsKey(aClass)) return null;
for (final Method method1 : ReflectionUtil.getClassPublicMethods(aClass)) {
if ((method = findPrimaryKeyAnnotatedMethod(method1, aClass)) != null) {
break;
}
}
ourPrimaryKeyMethods.put(aClass, method);
}
return method;
}
示例3: create
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Override
@Nullable
protected Method create(final Class key) {
for (final Method method : ReflectionUtil.getClassPublicMethods(key)) {
if (JavaMethod.getMethod(key, method).getAnnotation(NameValue.class) != null) {
return method;
}
}
return null;
}
示例4: findMethod
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Nullable
public static Method findMethod(Class clazz, @NonNls String methodName) {
for (Method method : ReflectionUtil.getClassPublicMethods(clazz)) {
if (methodName.equals(method.getName())) {
return method;
}
}
return null;
}