attrib4j.cfparse
Class CFParseAttributeExtractor

java.lang.Object
  |
  +--attrib4j.cfparse.CFParseAttributeExtractor
All Implemented Interfaces:
AttributeExtractor

public class CFParseAttributeExtractor
extends java.lang.Object
implements AttributeExtractor

AttributeExtractor implementation using the CFParse bytecode library. Make sure you use the AttributeExtractor that pairs up with the corresponding ClassAnnotator implementation.

Version:
$Revision: 1.9 $ $Date: 2003/04/18 23:52:41 $
Author:
Mark Pollack, Ted Neward

Constructor Summary
CFParseAttributeExtractor()
          Do nothing ctor.
 
Method Summary
 void close()
          Close any resouces that were opened.
 Attribute[] getClassAttributes()
          Retreives attributes associated with the class.
 Attribute[] getClassAttributes(java.lang.Class filter)
          Retrieves attributes associated with the class of a given type.
 java.lang.Object[] getCustomClassAttributes()
          Retreives custom attributes applied to the class.
 java.lang.Object[] getCustomClassAttributes(java.lang.Object filter)
          Return the list (possible empty) of attribute associated with the class that instances of the 'filter' class.
 java.lang.Object[] getCustomFieldAttributes(java.lang.String fieldName)
          Retreives custom attributes applied to a specific field of the class.
 java.lang.Object[] getCustomMethodAttributes(java.lang.String methodName, java.lang.String[] methodParamTypes)
          Retreives custom attributes applied to a specific method of the class.
 java.lang.Object[] getCustomMethodAttributes(java.lang.String methodName, java.lang.String[] methodParamTypes, java.lang.Class filter)
          Retreives custom attributes applied to a specific method of the class.
 Attribute[] getFieldAttributes(java.lang.String fieldName)
          Retreives custom attributes applied to a specific field of the class.
 Attribute[] getMethodAttributes(java.lang.String methodName, java.lang.String[] methodParamTypes)
          A no-op implementation since cfparse is very low on the list of priorities to support now that there is a BCEL implementation.
 Attribute[] getMethodAttributes(java.lang.String methodName, java.lang.String[] methodParamTypes, java.lang.Class filter)
          A no-op implementation since cfparse is very low on the list of priorities to support now that there is a BCEL implementation.
 void open(java.lang.String qualifiedClassname, java.lang.ClassLoader cl)
          Using the provided class loader, load the class so that it can be passed to a bytecode manipulation library.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CFParseAttributeExtractor

public CFParseAttributeExtractor()
Do nothing ctor.

Method Detail

open

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

Specified by:
open in interface AttributeExtractor
Parameters:
qualifiedClassname - The fully qualified classname - contains package information, ie java.lang.String
cl - Classloader to use to load the class.

close

public void close()
Close any resouces that were opened.

Specified by:
close in interface AttributeExtractor

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.

getCustomClassAttributes

public java.lang.Object[] getCustomClassAttributes()
Retreives custom attributes applied to the class.

Returns:
An array of custom attributes. Null if there are no attributes.

getCustomClassAttributes

public java.lang.Object[] getCustomClassAttributes(java.lang.Object filter)
Return the list (possible empty) of attribute associated with the class that instances of the 'filter' class.

Parameters:
filter - The instance that will filter out only matching class types.
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)
A no-op implementation since cfparse is very low on the list of priorities to support now that there is a BCEL implementation.

Specified by:
getMethodAttributes in interface AttributeExtractor
Parameters:
methodName - The name of the method.
methodParamTypes - The signature of the method.
Returns:
null
See Also:
AttributeExtractor.getMethodAttributes(String, String[])

getMethodAttributes

public Attribute[] getMethodAttributes(java.lang.String methodName,
                                       java.lang.String[] methodParamTypes,
                                       java.lang.Class filter)
A no-op implementation since cfparse is very low on the list of priorities to support now that there is a BCEL implementation.

Specified by:
getMethodAttributes in interface AttributeExtractor
Parameters:
methodName - The name of the method.
methodParamTypes - The signature of the method.
filter - The class object used to filter the returned attribute classes.
Returns:
null
See Also:
AttributeExtractor.getMethodAttributes(java.lang.String, java.lang.String[], java.lang.Class)

getCustomMethodAttributes

public java.lang.Object[] getCustomMethodAttributes(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.

getCustomMethodAttributes

public java.lang.Object[] getCustomMethodAttributes(java.lang.String methodName,
                                                    java.lang.String[] methodParamTypes,
                                                    java.lang.Class filter)
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 Attribute[] getFieldAttributes(java.lang.String fieldName)
Description copied from interface: AttributeExtractor
Retreives custom attributes applied to a specific field of the class.

Specified by:
getFieldAttributes in interface AttributeExtractor
Parameters:
fieldName - the name of a class field.
Returns:
An array of custom attributes. Null if there are no attributes.

getCustomFieldAttributes

public java.lang.Object[] getCustomFieldAttributes(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 © 2002-2003 Mark Pollack. All Rights Reserved.