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
Class es 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
ConstructorParameter s that have an attribute of the specified class. |
java.util.Collection |
getConstructors(java.lang.Class attributeClass)
Gets a Collection of the
Constructor s that have an attribute of the specified class. |
java.util.Collection |
getFields(java.lang.Class attributeClass)
Gets a Collection of the
Field s that have an attribute of the specified class. |
java.util.Collection |
getMethodParameters(java.lang.Class attributeClass)
Gets a Collection of the
MethodParameter s that have an attribute of the specified class. |
java.util.Collection |
getMethods(java.lang.Class attributeClass)
Gets a Collection of the
Method s that have an attribute of the specified class. |
java.util.Collection |
getMethodsReturning(java.lang.Class attributeClass)
Gets a Collection of the
Method s 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.Exception
private 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.Exception
private void loadFromURL(java.net.URL url) throws java.lang.Exception
java.lang.Exception
public 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)
Class
es that have an attribute of the specified class.
The Collection contains the classes (Class).public java.util.Collection getMethods(java.lang.Class attributeClass)
Method
s 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)
Method
s 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)
Field
s 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)
Constructor
s 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)
ConstructorParameter
s that have an attribute of the specified class.
The Collection contains the methods (AttributeIndex.ConstructorParameter
).public java.util.Collection getMethodParameters(java.lang.Class attributeClass)
MethodParameter
s that have an attribute of the specified class.
The Collection contains the methods (AttributeIndex.MethodParameter
).