1
2
3
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
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 }