本文整理汇总了Java中com.intellij.util.ReflectionUtil.getDeclaredMethod方法的典型用法代码示例。如果您正苦于以下问题:Java ReflectionUtil.getDeclaredMethod方法的具体用法?Java ReflectionUtil.getDeclaredMethod怎么用?Java ReflectionUtil.getDeclaredMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.ReflectionUtil
的用法示例。
在下文中一共展示了ReflectionUtil.getDeclaredMethod方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLocationInExpandControl
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
private boolean isLocationInExpandControl(final TreePath path, final int x, final int y) {
final TreeUI ui = getUI();
if (!(ui instanceof BasicTreeUI)) return false;
try {
Class aClass = ui.getClass();
while (BasicTreeUI.class.isAssignableFrom(aClass) && !BasicTreeUI.class.equals(aClass)) {
aClass = aClass.getSuperclass();
}
final Method method = ReflectionUtil.getDeclaredMethod(aClass, "isLocationInExpandControl", TreePath.class, int.class, int.class);
if (method != null) {
return (Boolean)method.invoke(ui, path, x, y);
}
}
catch (Throwable ignore) { }
return false;
}
示例2: enableRemoveOnCancelPolicy
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
private static void enableRemoveOnCancelPolicy(ScheduledThreadPoolExecutor executor) {
if (Patches.USE_REFLECTION_TO_ACCESS_JDK7) {
try {
Method setRemoveOnCancelPolicy = ReflectionUtil.getDeclaredMethod(ScheduledThreadPoolExecutor.class, "setRemoveOnCancelPolicy", boolean.class);
setRemoveOnCancelPolicy.invoke(executor, true);
}
catch (Exception ignored) {
}
}
}
示例3: equal
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
boolean equal(@Nullable Binding binding, @Nullable Object currentValue, @Nullable Object defaultValue) {
if (defaultValue instanceof Element && currentValue instanceof Element) {
return JDOMUtil.areElementsEqual((Element)currentValue, (Element)defaultValue);
}
else {
if (currentValue == defaultValue) {
return true;
}
if (currentValue == null || defaultValue == null) {
return false;
}
if (binding instanceof BasePrimitiveBinding) {
Binding referencedBinding = ((BasePrimitiveBinding)binding).myBinding;
if (referencedBinding instanceof BeanBinding) {
BeanBinding classBinding = (BeanBinding)referencedBinding;
ThreeState compareByFields = classBinding.compareByFields;
if (compareByFields == ThreeState.UNSURE) {
compareByFields = ReflectionUtil.getDeclaredMethod(classBinding.myBeanClass, "equals", Object.class) == null ? ThreeState.YES : ThreeState.NO;
classBinding.compareByFields = compareByFields;
}
if (compareByFields == ThreeState.YES) {
return classBinding.equalByFields(currentValue, defaultValue, this);
}
}
}
return Comparing.equal(currentValue, defaultValue);
}
}
示例4: getDeclaredMethod
import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Nullable
private Method getDeclaredMethod(final Class aClass) {
final Method method = ReflectionUtil.getMethod(aClass, myMethodName, myMethodParameters);
return method == null ? ReflectionUtil.getDeclaredMethod(aClass, myMethodName, myMethodParameters) : method;
}