KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > aspectwerkz > reflect > ClassInfo


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.aspectwerkz.reflect;
5
6 import com.tc.backport175.bytecode.AnnotationReader;
7 import com.tc.backport175.bytecode.AnnotationElement;
8
9 /**
10  * Interface for the class info implementations.
11  *
12  * @author <a HREF="mailto:jboner@codehaus.org">Jonas BonŽr </a>
13  */

14 public interface ClassInfo extends ReflectionInfo {
15
16   final static AnnotationElement.Annotation[] EMPTY_ANNOTATION_ARRAY = new AnnotationElement.Annotation[0];
17
18   /**
19    * Returns a constructor info by its hash.
20    * Looks up in the hierarchy
21    *
22    * @param hash
23    * @return
24    */

25   ConstructorInfo getConstructor(int hash);
26
27   /**
28    * Returns the constructors info.
29    * Does not looks up in the hierarchy
30    *
31    * @return the constructors info
32    */

33   ConstructorInfo[] getConstructors();
34
35   /**
36    * Returns a method info by its hash.
37    * Looks up in the hierarchy
38    *
39    * @param hash
40    * @return
41    */

42   MethodInfo getMethod(int hash);
43
44   /**
45    * Returns the methods info.
46    * Does not looks up in the hierarchy
47    *
48    * @return the methods info
49    */

50   MethodInfo[] getMethods();
51
52   /**
53    * Returns a field info by its hash.
54    * Looks up in the hierarchy
55    *
56    * @param hash
57    * @return
58    */

59   FieldInfo getField(int hash);
60
61   /**
62    * Returns the fields info.
63    * Does not looks up in the hierarchy
64    *
65    * @return the fields info
66    */

67   FieldInfo[] getFields();
68
69   /**
70    * Returns the class loader that loaded this class.
71    *
72    * @return the class loader
73    */

74   ClassLoader JavaDoc getClassLoader();
75
76   /**
77    * Checks if the class has a static initalizer.
78    *
79    * @return
80    */

81   boolean hasStaticInitializer();
82
83   /**
84    * Returns the static initializer info of the current underlying class if any.
85    *
86    * @return
87    */

88   StaticInitializationInfo staticInitializer();
89
90   /**
91    * Returns the interfaces.
92    *
93    * @return the interfaces
94    */

95   ClassInfo[] getInterfaces();
96
97   /**
98    * Returns the super class, or null (superclass of java.lang.Object)
99    *
100    * @return the super class
101    */

102   ClassInfo getSuperclass();
103
104   /**
105    * Returns the component type if array type else null.
106    *
107    * @return the component type
108    */

109   ClassInfo getComponentType();
110
111   /**
112    * Is the class an interface.
113    *
114    * @return
115    */

116   boolean isInterface();
117
118   /**
119    * Is the class a primitive type.
120    *
121    * @return
122    */

123   boolean isPrimitive();
124
125   /**
126    * Is the class an array type.
127    *
128    * @return
129    */

130   boolean isArray();
131
132   /**
133    * @return
134    */

135   AnnotationReader getAnnotationReader();
136
137   public static class NullClassInfo implements ClassInfo {
138
139     public ConstructorInfo getConstructor(int hash) {
140       return null;
141     }
142
143     public ConstructorInfo[] getConstructors() {
144       return new ConstructorInfo[0];
145     }
146
147     public MethodInfo getMethod(int hash) {
148       return null;
149     }
150
151     public MethodInfo[] getMethods() {
152       return new MethodInfo[0];
153     }
154
155     public FieldInfo getField(int hash) {
156       return null;
157     }
158
159     public FieldInfo[] getFields() {
160       return new FieldInfo[0];
161     }
162
163     public boolean hasStaticInitializer() {
164       return false;
165     }
166
167     /**
168      * @see com.tc.aspectwerkz.reflect.ClassInfo#staticInitializer()
169      */

170     public StaticInitializationInfo staticInitializer() {
171       return null;
172     }
173
174     public ClassInfo[] getInterfaces() {
175       return new ClassInfo[0];
176     }
177
178     public ClassInfo getSuperclass() {
179       return null;
180     }
181
182     public ClassLoader JavaDoc getClassLoader() {
183       return null;
184     }
185
186     public ClassInfo getComponentType() {
187       return null;
188     }
189
190     public boolean isInterface() {
191       return false;
192     }
193
194     public boolean isPrimitive() {
195       return false;
196     }
197
198     public boolean isArray() {
199       return false;
200     }
201
202     public String JavaDoc getName() {
203       return null;
204     }
205
206     public String JavaDoc getSignature() {
207       return null;
208     }
209     
210     public String JavaDoc getGenericsSignature() {
211       return null;
212     }
213
214     public int getModifiers() {
215       return 0;
216     }
217
218     public AnnotationElement.Annotation[] getAnnotations() {
219       return EMPTY_ANNOTATION_ARRAY;
220     }
221
222     public AnnotationReader getAnnotationReader() {
223       return null;
224     }
225   }
226 }
227
228
Popular Tags