当前位置: 首页>>代码示例>>Java>>正文


Java ReflectionUtil.getDeclaredMethod方法代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:Tree.java

示例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) {
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JobScheduler.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:SkipDefaultsSerializationFilter.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:JavaMethodSignature.java


注:本文中的com.intellij.util.ReflectionUtil.getDeclaredMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。