View Javadoc

1   /*
2    * To change this template, choose Tools | Templates
3    * and open the template in the editor.
4    */
5   package org.lsst.ccs.utilities.commands;
6   
7   import java.lang.reflect.Method;
8   import java.util.ArrayList;
9   import java.util.List;
10  
11  /**
12   *
13   * @author turri
14   */
15  public class CommandUtilities {
16      
17      
18      public static List<Method> getAnnotatedMethodsFromObject(Object obj, Class annotation) {
19          ArrayList<Method> methods = new ArrayList<Method>();
20          for (Method m : obj.getClass().getMethods()) {
21              Object an = m.getAnnotation(annotation);
22              if (an != null) {
23                  methods.add(m);
24              }
25          }
26          return methods;
27      }
28      
29      
30      
31  }