org.codehaus.aspectwerkz.attribdef.definition.attribute.bcel
Class BcelAttributeExtractor

java.lang.Object
  extended byorg.codehaus.aspectwerkz.attribdef.definition.attribute.bcel.BcelAttributeExtractor
All Implemented Interfaces:
AttributeExtractor

public class BcelAttributeExtractor
extends java.lang.Object
implements AttributeExtractor

BCEL implementation of the AttributeExtractor interface. Extracts attributes from the class file on class, method and field level. Based on code from the Attrib4j project by Mark Pollack and Ted Neward (http://attrib4j.sourceforge.net/).

Author:
Jonas Bonér

Constructor Summary
BcelAttributeExtractor()
           
 
Method Summary
 java.lang.Object[] getClassAttributes()
          Returns the class attributes.
 java.lang.Object[] getFieldAttributes(java.lang.String fieldName)
          Return all the attributes associated with a field.
 java.lang.Object[] getMethodAttributes(java.lang.String methodName, java.lang.String[] methodParamTypes)
          Return all the attributes associated with a method that have a particular method signature.
 void initialize(java.lang.String className, java.lang.ClassLoader loader)
          Open the classfile and parse it in to the BCEL library.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BcelAttributeExtractor

public BcelAttributeExtractor()
Method Detail

initialize

public void initialize(java.lang.String className,
                       java.lang.ClassLoader loader)
Open the classfile and parse it in to the BCEL library.

Specified by:
initialize in interface AttributeExtractor
Parameters:
className - the class name to load.
loader - the classloader to use to get the inputstream of the .class file.

getClassAttributes

public java.lang.Object[] getClassAttributes()
Returns the class attributes.

Specified by:
getClassAttributes in interface AttributeExtractor
Returns:
the class attributes

getMethodAttributes

public java.lang.Object[] getMethodAttributes(java.lang.String methodName,
                                              java.lang.String[] methodParamTypes)
Return all the attributes associated with a method that have a particular method signature.

Specified by:
getMethodAttributes in interface AttributeExtractor
Parameters:
methodName - The name of the method.
methodParamTypes - An array of parameter types as given by the reflection api.
Returns:
the method attributes.

getFieldAttributes

public java.lang.Object[] getFieldAttributes(java.lang.String fieldName)
Return all the attributes associated with a field.

Specified by:
getFieldAttributes in interface AttributeExtractor
Parameters:
fieldName - The name of the field.
Returns:
the field attributes.


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