1 16 package net.sf.cglib.core; 17 18 import java.lang.reflect.*; 19 20 public class MethodInfoTransformer implements Transformer 21 { 22 private static final MethodInfoTransformer INSTANCE = new MethodInfoTransformer(); 23 24 public static MethodInfoTransformer getInstance() { 25 return INSTANCE; 26 } 27 28 public Object transform(Object value) { 29 if (value instanceof Method) { 30 return ReflectUtils.getMethodInfo((Method)value); 31 } else if (value instanceof Constructor) { 32 return ReflectUtils.getMethodInfo((Constructor)value); 33 } else { 34 throw new IllegalArgumentException ("cannot get method info for " + value); 35 } 36 } 37 } 38 | Popular Tags |