attrib4j.bcel
Class BCELAttributeExtractor

java.lang.Object
  |
  +--attrib4j.bcel.BCELAttributeExtractor
All Implemented Interfaces:
AttributeExtractor

public class BCELAttributeExtractor
extends java.lang.Object
implements AttributeExtractor

This is the BCEL implementation for extracting attributes from the class file. TODO Consider returning a Set or List TODO more convenience methods for selection of attributes TODO code cleanup - put reading of attribute in common util method. Created: Thu Oct 17 19:17:15 2002

Version:
$Revsion$ $Date: 2003/04/24 05:41:54 $
Author:

Constructor Summary
BCELAttributeExtractor()
           
 
Method Summary
 void close()
          A do-nothing method for now.
 Attribute[] getClassAttributes()
          Retreives attributes associated with the class.
 Attribute[] getClassAttributes(java.lang.Class filter)
          Retrieves attributes associated with the class of a given type.
 Attribute[] getFieldAttributes(java.lang.String fieldName)
          Return all the attributes associated with a field.
 Attribute[] getMethodAttributes(java.lang.String methodName, java.lang.String[] methodParamTypes)
          Return all the attributes associated with a method that have a particular method signature.
 Attribute[] getMethodAttributes(java.lang.String methodName, java.lang.String[] methodParamTypes, java.lang.Class filter)
          Return all the attributes associated with a method that have a particular method signature.
 void open(java.lang.String qualifiedClassname, java.lang.ClassLoader cl)
          Open the classfile and parse it in to the BCEL library.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BCELAttributeExtractor

public BCELAttributeExtractor()
Method Detail

open

public void open(java.lang.String qualifiedClassname,
                 java.lang.ClassLoader cl)
Open the classfile and parse it in to the BCEL library.

Specified by:
open in interface AttributeExtractor
Parameters:
qualifiedClassname - The class name to load.
cl - the classloader to use to get the inputstream of the .class file.

getClassAttributes

public Attribute[] getClassAttributes()
Description copied from interface: AttributeExtractor
Retreives attributes associated with the class.

Specified by:
getClassAttributes in interface AttributeExtractor
Returns:
An array of attributes that satisfy the instanceof comparison with the filter class. Null if there are no attributes associated with the class.

getClassAttributes

public Attribute[] getClassAttributes(java.lang.Class filter)
Description copied from interface: AttributeExtractor
Retrieves attributes associated with the class of a given type.

Specified by:
getClassAttributes in interface AttributeExtractor
Parameters:
filter - The class object used to filter the returned attribute classes.
Returns:
An array of attributes that satisfy the instanceof comparison with the filter class.

getMethodAttributes

public Attribute[] 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:
An array of attributes.

getMethodAttributes

public Attribute[] getMethodAttributes(java.lang.String methodName,
                                       java.lang.String[] methodParamTypes,
                                       java.lang.Class filter)
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.
filter - The class object used to filter the returned attribute classes.
Returns:
An array of attributes.

getFieldAttributes

public Attribute[] 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:
An array of attributes.

close

public void close()
A do-nothing method for now.

Specified by:
close in interface AttributeExtractor


Copyright © 2002-2003 Mark Pollack. All Rights Reserved.