org.codehaus.aspectwerkz.attribdef.definition.attribute
Interface AttributeExtractor

All Known Implementing Classes:
BcelAttributeExtractor

public interface AttributeExtractor

Methods that should be implemented in order to extract attributes associate with a class. An implementation this class needs to be provided for each bytecode manipulation library or other meta-data storage mechanism that is supported. Based on code from the Attrib4j project by Mark Pollack and Ted Neward (http://attrib4j.sourceforge.net/).

Author:
Jonas Bonér

Method Summary
 java.lang.Object[] getClassAttributes()
          Retreives attributes associated with the class.
 java.lang.Object[] getFieldAttributes(java.lang.String fieldName)
          Retreives custom attributes applied to a specific field of the class.
 java.lang.Object[] getMethodAttributes(java.lang.String methodName, java.lang.String[] methodParamTypes)
          Retreives custom attributes applied to a specific method of the class.
 void initialize(java.lang.String className, java.lang.ClassLoader loader)
          Using the provided class loader, load the class so that it can be passed to a bytecode manipulation library.
 

Method Detail

initialize

public void initialize(java.lang.String className,
                       java.lang.ClassLoader loader)
Using the provided class loader, load the class so that it can be passed to a bytecode manipulation library.

Parameters:
className - The fully qualified classname
loader - Classloader to user to load the class.

getClassAttributes

public java.lang.Object[] getClassAttributes()
Retreives attributes associated with the class.

Returns:
An array of attributes that satisfy the instanceof comparison with the filter class. Null if there are no attributes associated with the class.

getMethodAttributes

public java.lang.Object[] getMethodAttributes(java.lang.String methodName,
                                              java.lang.String[] methodParamTypes)
Retreives custom attributes applied to a specific method of the class.

Parameters:
methodName - The name of the method.
methodParamTypes - The signature of the method.
Returns:
An array of custom attributes. Null if there are no attributes.

getFieldAttributes

public java.lang.Object[] getFieldAttributes(java.lang.String fieldName)
Retreives custom attributes applied to a specific field of the class.

Parameters:
fieldName - the name of a class field.
Returns:
An array of custom attributes. Null if there are no attributes.


Copyright (c) 2002-2004 The AspectWerkz Team. All Rights Reserved.