|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ideanest.attributes.Attributes
The singleton access point to attributes set on various program elements.
Note that there are two matching sets of accessor methods: one takes reflected objects, the other strings. The two sets are roughly equivalent, however it is best to use the reflected versions of the accessors whenever possible, since it is impossible to pass an illegal argument to them. The string set is provided in case it is necessary to retrieve attributes for elements without forcing the containing class to be loaded. Accessors from this set will not check whether the specified element actually exists, since that would require loading it. They may also be unable to resolve attribute inheritance.
All implementations must be thread-safe.
Field Summary | |
static java.lang.String |
DEFAULT_IMPL_CLASS_NAME
|
static java.lang.String |
IMPL_CLASS_NAME_PROPKEY
|
Constructor Summary | |
Attributes()
|
Method Summary | |
abstract Bundle |
get(java.lang.Class klass)
Get the attributes bundle for the given class. |
abstract Bundle |
get(java.lang.reflect.Constructor constructor)
Get the attributes bundle for the given constructor. |
abstract Bundle |
get(java.lang.reflect.Field field)
Get the attributes bundle for the given field. |
abstract Bundle |
get(java.lang.reflect.Method method)
Get the attributes bundle for the given method. |
abstract Bundle |
getClass(java.lang.String className,
java.lang.ClassLoader classLoader)
Get the bundle of attributes for the given class. |
abstract Bundle |
getConstructor(java.lang.String className,
java.lang.String constructorSignature,
java.lang.ClassLoader classLoader)
Get the bundle of attributes for the given constructor. |
abstract Bundle |
getField(java.lang.String className,
java.lang.String fieldName,
java.lang.ClassLoader classLoader)
The the bundle of attributes for the given field. |
static Attributes |
getInstance()
Get the singleton instance of the Attributes class. |
abstract Bundle |
getMethod(java.lang.String className,
java.lang.String methodSignature,
java.lang.ClassLoader classLoader)
Get the bundle of attributes for the given method. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_IMPL_CLASS_NAME
public static final java.lang.String IMPL_CLASS_NAME_PROPKEY
Constructor Detail |
public Attributes()
Method Detail |
public abstract Bundle get(java.lang.Class klass)
klass
- the class for which attributes are needed
public abstract Bundle get(java.lang.reflect.Constructor constructor)
constructor
- the constructor for which attributes are needed
public abstract Bundle get(java.lang.reflect.Field field)
field
- the field for which attributes are needed
public abstract Bundle get(java.lang.reflect.Method method)
method
- the method for which attributes are needed
public abstract Bundle getClass(java.lang.String className, java.lang.ClassLoader classLoader)
className
- the fully qualified name of the classclassLoader
- the class loader to use when fetching attribute descriptors, if null
use the thread's context class loader
public abstract Bundle getConstructor(java.lang.String className, java.lang.String constructorSignature, java.lang.ClassLoader classLoader)
"java.lang.Thread.<init>(java.lang.Runnable,java.lang.String)"
.
className
- the fully qualified name of the constructor's classconstructorSignature
- the parameter types of the desired constructorclassLoader
- the class loader to use when fetching attribute descriptors, if null
use the thread's context class loader
public abstract Bundle getField(java.lang.String className, java.lang.String fieldName, java.lang.ClassLoader classLoader)
className
- the fully qualified name of the field's classfieldName
- the name of the desired fieldclassLoader
- the class loader to use when fetching attribute descriptors, if null
use the thread's context class loader
public static Attributes getInstance() throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
Attributes
class. The first time this
method is called, the class specified by the value of the system property keyed with
IMPL_CLASS_NAME_PROPKEY
will be instantiated. If not such property is
defined, the default class
will be instantiated.
Attributes
java.lang.InstantiationException
- if unable to instantiate the implementation class
java.lang.IllegalAccessException
- if unable to access the implementation class
java.lang.ClassNotFoundException
- if unable to find the implementation classpublic abstract Bundle getMethod(java.lang.String className, java.lang.String methodSignature, java.lang.ClassLoader classLoader)
Class.getName()
. The parameter types are
separated by commas, with no spaces. The return type is not listed. Methods with
no parameters must include an empty parameter list, '()'.
className
- the fully qualified name of the method's classmethodSignature
- the name and parameter types of the desired methodclassLoader
- the class loader to use when fetching attribute descriptors, if null
use the thread's context class loader
getClass(String,ClassLoader)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |