public class AttributeIndex
extends java.lang.Object
Indexed and that the
attribute indexer tool has been run on the jar file containing the
classes.| Modifier and Type | Class and Description |
|---|---|
static class |
AttributeIndex.ConstructorParameter
A constructor parameter.
|
private static class |
AttributeIndex.IndexNode |
static class |
AttributeIndex.MethodParameter
Reference to a method parameter.
|
| Modifier and Type | Field and Description |
|---|---|
private java.lang.ClassLoader |
classLoader |
private java.util.HashMap |
index |
| Constructor and Description |
|---|
AttributeIndex(java.lang.ClassLoader cl)
Creates a new AttributeIndex for the given ClassLoader.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addClass(java.lang.String clazzName)
Add a class to the index.
|
private void |
addIndex(java.util.Collection attributes,
java.lang.Class clazz) |
private void |
addIndex(java.util.Collection attributes,
java.lang.reflect.Constructor constructor) |
private void |
addIndex(java.util.Collection attributes,
java.lang.reflect.Constructor ctor,
int parameter) |
private void |
addIndex(java.util.Collection attributes,
java.lang.reflect.Field field) |
private void |
addIndex(java.util.Collection attributes,
java.lang.reflect.Method method) |
private void |
addIndex(java.util.Collection attributes,
java.lang.reflect.Method method,
int parameter) |
private void |
addReturnIndex(java.util.Collection attributes,
java.lang.reflect.Method method) |
java.util.Collection |
getClasses(java.lang.Class attributeClass)
Gets a Collection of the
Classes that have an attribute of the specified class. |
java.util.Collection |
getClassesWithAttribute(java.lang.Class attributeClass)
Deprecated.
Use the getClasses(Class) method instead.
|
java.util.Collection |
getClassesWithAttribute(java.lang.String attributeClass)
Deprecated.
Use the getClasses(Class) method instead.
|
java.util.Collection |
getConstructorParameters(java.lang.Class attributeClass)
Gets a Collection of the
ConstructorParameters that have an attribute of the specified class. |
java.util.Collection |
getConstructors(java.lang.Class attributeClass)
Gets a Collection of the
Constructors that have an attribute of the specified class. |
java.util.Collection |
getFields(java.lang.Class attributeClass)
Gets a Collection of the
Fields that have an attribute of the specified class. |
java.util.Collection |
getMethodParameters(java.lang.Class attributeClass)
Gets a Collection of the
MethodParameters that have an attribute of the specified class. |
java.util.Collection |
getMethods(java.lang.Class attributeClass)
Gets a Collection of the
Methods that have an attribute of the specified class. |
java.util.Collection |
getMethodsReturning(java.lang.Class attributeClass)
Gets a Collection of the
Methods whose return value has an attribute of the specified class. |
private AttributeIndex.IndexNode |
getNode(java.lang.Class attributeClass) |
private void |
loadFromURL(java.net.URL url)
Load the attrs.index from a given URL.
|
private final java.util.HashMap index
private final java.lang.ClassLoader classLoader
public AttributeIndex(java.lang.ClassLoader cl)
throws java.lang.Exception
java.lang.Exceptionprivate AttributeIndex.IndexNode getNode(java.lang.Class attributeClass)
private void addIndex(java.util.Collection attributes,
java.lang.Class clazz)
private void addIndex(java.util.Collection attributes,
java.lang.reflect.Field field)
private void addIndex(java.util.Collection attributes,
java.lang.reflect.Method method)
private void addIndex(java.util.Collection attributes,
java.lang.reflect.Constructor constructor)
private void addReturnIndex(java.util.Collection attributes,
java.lang.reflect.Method method)
private void addIndex(java.util.Collection attributes,
java.lang.reflect.Method method,
int parameter)
private void addIndex(java.util.Collection attributes,
java.lang.reflect.Constructor ctor,
int parameter)
private void addClass(java.lang.String clazzName)
throws java.lang.Exception
java.lang.Exceptionprivate void loadFromURL(java.net.URL url)
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Collection getClassesWithAttribute(java.lang.String attributeClass)
public java.util.Collection getClassesWithAttribute(java.lang.Class attributeClass)
public java.util.Collection getClasses(java.lang.Class attributeClass)
Classes that have an attribute of the specified class.
The Collection contains the classes (Class).public java.util.Collection getMethods(java.lang.Class attributeClass)
Methods that have an attribute of the specified class.
The Collection contains the methods (java.lang.reflect.Method).public java.util.Collection getMethodsReturning(java.lang.Class attributeClass)
Methods whose return value has an attribute of the specified class.
The Collection contains the methods (java.lang.reflect.Method).public java.util.Collection getFields(java.lang.Class attributeClass)
Fields that have an attribute of the specified class.
The Collection contains the methods (java.lang.reflect.Field).public java.util.Collection getConstructors(java.lang.Class attributeClass)
Constructors that have an attribute of the specified class.
The Collection contains the methods (java.lang.reflect.Constructor).public java.util.Collection getConstructorParameters(java.lang.Class attributeClass)
ConstructorParameters that have an attribute of the specified class.
The Collection contains the methods (AttributeIndex.ConstructorParameter).public java.util.Collection getMethodParameters(java.lang.Class attributeClass)
MethodParameters that have an attribute of the specified class.
The Collection contains the methods (AttributeIndex.MethodParameter).