1 package attrib4j;
2
3 /***
4 * Methods that should be implemented in order to extract attributes
5 * associate with a class. An implementation this class needs to be
6 * provided for each bytecode manipulation library or other meta-data
7 * storage mechanism that is supported.
8 *
9 * TODO add utility method to get attributes of certain classes, or for
10 * methods of certain signatures.
11 *
12 * @author <a href="mailto:mpollack@speakeasy.net">Mark Pollack</a>
13 * @version $Id: AttributeExtractor.java,v 1.9 2003/04/18 23:52:41 markpollack Exp $
14 */
15 public interface AttributeExtractor {
16
17 /***
18 * Using the provided class loader, load the class so that it can
19 * be passed to a bytecode manipulation library.
20 *
21 * @param qualifiedClassname The fully qualified classname - contains
22 * package information, ie java.lang.String
23 * @param cl Classload to user to load the class.
24 */
25 void open(String qualifiedClassname, ClassLoader cl);
26
27 /***
28 * Close any resouces that were opened.
29 *
30 */
31 void close();
32
33 /***
34 * Retreives attributes associated with the class.
35 *
36 * @return An array of attributes that satisfy the instanceof
37 * comparison with the filter class. Null if there are no
38 * attributes associated with the class.
39 */
40 Attribute[] getClassAttributes();
41
42 /***
43 * Retrieves attributes associated with the class of a given type.
44 *
45 * @param filter The class object used to filter the returned attribute classes.
46 * @return An array of attributes that satisfy the instanceof
47 * comparison with the filter class.
48 */
49 Attribute[] getClassAttributes(Class filter);
50
51 /***
52 * Retreives custom attributes applied to a specific method of the class.
53 *
54 * @param methodName The name of the method.
55 * @param methodParamTypes The signature of the method.
56 * @return An array of custom attributes. Null if there are no
57 * attributes.
58 */
59 Attribute[] getMethodAttributes(
60 String methodName,
61 String[] methodParamTypes);
62
63 /***
64 * Retreives custom attributes applied to a specific method of the class
65 * filtered by a particular attribute class.
66 *
67 * @param methodName The name of the method.
68 * @param methodParamTypes The signature of the method.
69 * @param filter The class object used to filter the returned attribute
70 * classes.
71 * @return An array of custom attributes. Null if there are no
72 * attributes.
73 */
74 Attribute[] getMethodAttributes(
75 String methodName,
76 String[] methodParamTypes,
77 Class filter);
78
79 /***
80 * Retreives custom attributes applied to a specific field of the class.
81 *
82 * @param fieldName the name of a class field.
83 * @return An array of custom attributes. Null if there are no
84 * attributes.
85 */
86 Attribute[] getFieldAttributes(String fieldName);
87
88 }
This page was automatically generated by Maven