1 55 package org.lateralnz.panther.deploy; 56 57 import java.lang.reflect.Method ; 58 59 import org.lateralnz.common.util.ObjectUtils; 60 61 66 public class MethodDescriptor { 67 private String name; 68 private String [] exceptionTypes; 69 private String [] parameterTypes; 70 private String returnType; 71 private boolean transaction = false; 72 private String transactionType; 73 74 public MethodDescriptor(Method method, boolean transaction, String transactionType) { 75 this.name = method.getName(); 76 this.transaction = transaction; 77 this.transactionType = transactionType; 78 this.exceptionTypes = new String [method.getExceptionTypes().length]; 79 for (int i = 0; i < exceptionTypes.length; i++) { 80 this.exceptionTypes[i] = method.getExceptionTypes()[i].getName(); 81 } 82 this.parameterTypes = new String [method.getParameterTypes().length]; 83 for (int i = 0; i < parameterTypes.length; i++) { 84 this.parameterTypes[i] = ObjectUtils.getParameterType(method.getParameterTypes()[i]); 85 } 86 this.returnType = ObjectUtils.getParameterType(method.getReturnType()); 87 } 88 89 public String getName() { 90 return name; 91 } 92 93 public String [] getExceptionTypes() { 94 return exceptionTypes; 95 } 96 97 public String [] getParameterTypes() { 98 return parameterTypes; 99 } 100 101 public String getReturnType() { 102 return returnType; 103 } 104 105 public boolean getTransaction() { 106 return transaction; 107 } 108 109 public String getTransactionType() { 110 return transactionType; 111 } 112 } | Popular Tags |