001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
003: */
004: package com.tc.aspectwerkz.reflect;
005:
006: import com.tc.backport175.bytecode.AnnotationReader;
007: import com.tc.backport175.bytecode.AnnotationElement;
008:
009: /**
010: * Interface for the class info implementations.
011: *
012: * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
013: */
014: public interface ClassInfo extends ReflectionInfo {
015:
016: final static AnnotationElement.Annotation[] EMPTY_ANNOTATION_ARRAY = new AnnotationElement.Annotation[0];
017:
018: /**
019: * Returns a constructor info by its hash.
020: * Looks up in the hierarchy
021: *
022: * @param hash
023: * @return
024: */
025: ConstructorInfo getConstructor(int hash);
026:
027: /**
028: * Returns the constructors info.
029: * Does not looks up in the hierarchy
030: *
031: * @return the constructors info
032: */
033: ConstructorInfo[] getConstructors();
034:
035: /**
036: * Returns a method info by its hash.
037: * Looks up in the hierarchy
038: *
039: * @param hash
040: * @return
041: */
042: MethodInfo getMethod(int hash);
043:
044: /**
045: * Returns the methods info.
046: * Does not looks up in the hierarchy
047: *
048: * @return the methods info
049: */
050: MethodInfo[] getMethods();
051:
052: /**
053: * Returns a field info by its hash.
054: * Looks up in the hierarchy
055: *
056: * @param hash
057: * @return
058: */
059: FieldInfo getField(int hash);
060:
061: /**
062: * Returns the fields info.
063: * Does not looks up in the hierarchy
064: *
065: * @return the fields info
066: */
067: FieldInfo[] getFields();
068:
069: /**
070: * Returns the class loader that loaded this class.
071: *
072: * @return the class loader
073: */
074: ClassLoader getClassLoader();
075:
076: /**
077: * Checks if the class has a static initalizer.
078: *
079: * @return
080: */
081: boolean hasStaticInitializer();
082:
083: /**
084: * Returns the static initializer info of the current underlying class if any.
085: *
086: * @return
087: */
088: StaticInitializationInfo staticInitializer();
089:
090: /**
091: * Returns the interfaces.
092: *
093: * @return the interfaces
094: */
095: ClassInfo[] getInterfaces();
096:
097: /**
098: * Returns the super class, or null (superclass of java.lang.Object)
099: *
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: }
|