1 6 7 package org.jfox.ioc.management; 8 9 import java.io.Serializable ; 10 import java.lang.reflect.Method ; 11 12 import org.jfox.ioc.util.Methods; 13 14 17 18 public class ManagementOperationInfo implements Serializable , Comparable { 19 private String description; 20 private Method method; 21 private String hash = null; 22 23 public ManagementOperationInfo(Method method) { 24 this(method, method.getName()); 25 } 26 27 public ManagementOperationInfo(Method method, String description) { 28 this.method = method; 29 this.description = description; 30 } 31 32 public String getName() { 33 return method.getName(); 34 } 35 36 public String getDescription() { 37 return description; 38 } 39 40 public Class [] getParameterTypes() { 41 return method.getParameterTypes(); 42 } 43 44 public Class getReturnType() { 45 return method.getReturnType(); 46 } 47 48 public String getMethodHashCode() { 49 if(hash == null) { 50 hash = "" + Methods.getMethodHash(method); 51 } 52 return hash; 53 } 54 55 56 public String toString() { 57 return "ManagementOperationInfo{" + 58 "hash='" + hash + "'" + 59 ", description='" + description + "'" + 60 ", method=" + method + 61 "}"; 62 } 63 64 public int compareTo(Object o) { 65 if(o instanceof ManagementOperationInfo) { 66 return getName().compareTo(((ManagementOperationInfo) o).getName()); 67 } 68 return 0; 69 } 70 71 public boolean isGetter() { 72 return Methods.isGetMethod(method); 73 } 74 75 public Method getMethod() { 76 return method; 77 } 78 79 public static void main(String [] args) { 80 81 } 82 } 83 84 | Popular Tags |