Exemplo n.º 1
0
 /**
  * Returns the {@link MethodInfo} for the given method if it exists or null if there is no
  * metadata available for the given method
  */
 public MethodInfo getMethodInfo(Method method) {
   MethodInfo answer = methodMap.get(method);
   if (answer == null) {
     // maybe the method is defined on a base class?
     if (type != Object.class) {
       Class<?> superclass = type.getSuperclass();
       if (superclass != null && superclass != Object.class) {
         BeanInfo superBeanInfo = new BeanInfo(camelContext, superclass, strategy);
         return superBeanInfo.getMethodInfo(method);
       }
     }
   }
   return answer;
 }
Exemplo n.º 2
0
  /**
   * Returns the {@link MethodInfo} for the given method if it exists or null if there is no
   * metadata available for the given method
   */
  public MethodInfo getMethodInfo(Method method) {
    MethodInfo answer = methodMap.get(method);
    if (answer == null) {
      // maybe the method overrides, and the method map keeps info of the source override we can use
      for (Method source : methodMap.keySet()) {
        if (ObjectHelper.isOverridingMethod(source, method, false)) {
          answer = methodMap.get(source);
          break;
        }
      }
    }

    if (answer == null) {
      // maybe the method is defined on a base class?
      if (type != Object.class) {
        Class<?> superclass = type.getSuperclass();
        if (superclass != null && superclass != Object.class) {
          BeanInfo superBeanInfo = new BeanInfo(camelContext, superclass, strategy);
          return superBeanInfo.getMethodInfo(method);
        }
      }
    }
    return answer;
  }