32 import java.util.ArrayList; 33 34 /** 35 * A MethodDescriptor describes a particular method that a Java Bean 36 * supports for external access from other components. 37 * 38 * @since 1.1 39 */ 40 41 public class MethodDescriptor extends FeatureDescriptor { 42 43 private final MethodRef methodRef = new MethodRef(); 44 45 private String[] paramNames; 46 47 private List<WeakReference<Class<?>>> params; 48 49 private ParameterDescriptor parameterDescriptors[]; 50 51 /** 52 * Constructs a <code>MethodDescriptor</code> from a 53 * <code>Method</code>. 54 * 55 * @param method The low-level method information. 56 */ 57 public MethodDescriptor(Method method) { 58 this(method, null); 59 } 60 61 62 /** 63 * Constructs a <code>MethodDescriptor</code> from a 64 * <code>Method</code> providing descriptive information for each 65 * of the method's parameters. 66 * 67 * @param method The low-level method information. 68 * @param parameterDescriptors Descriptive information for each of the 69 * method's parameters. 70 */ 71 public MethodDescriptor(Method method, 72 ParameterDescriptor parameterDescriptors[]) { 73 setName(method.getName()); 74 setMethod(method); 75 this.parameterDescriptors = (parameterDescriptors != null) 76 ? parameterDescriptors.clone() 77 : null; 78 } 79 80 /** 81 * Gets the method that this MethodDescriptor encapsulates. 82 * 83 * @return The low-level description of the method 84 */ | 32 import java.util.ArrayList; 33 34 /** 35 * A MethodDescriptor describes a particular method that a Java Bean 36 * supports for external access from other components. 37 * 38 * @since 1.1 39 */ 40 41 public class MethodDescriptor extends FeatureDescriptor { 42 43 private final MethodRef methodRef = new MethodRef(); 44 45 private String[] paramNames; 46 47 private List<WeakReference<Class<?>>> params; 48 49 private ParameterDescriptor parameterDescriptors[]; 50 51 /** 52 * Constructs a {@code MethodDescriptor} from a 53 * {@code Method}. 54 * 55 * @param method The low-level method information. 56 */ 57 public MethodDescriptor(Method method) { 58 this(method, null); 59 } 60 61 62 /** 63 * Constructs a {@code MethodDescriptor} from a 64 * {@code Method} providing descriptive information for each 65 * of the method's parameters. 66 * 67 * @param method The low-level method information. 68 * @param parameterDescriptors Descriptive information for each of the 69 * method's parameters. 70 */ 71 public MethodDescriptor(Method method, 72 ParameterDescriptor parameterDescriptors[]) { 73 setName(method.getName()); 74 setMethod(method); 75 this.parameterDescriptors = (parameterDescriptors != null) 76 ? parameterDescriptors.clone() 77 : null; 78 } 79 80 /** 81 * Gets the method that this MethodDescriptor encapsulates. 82 * 83 * @return The low-level description of the method 84 */ |