org.codehaus.aspectwerkz.annotation.instrumentation
Interface AttributeEnhancer

All Known Implementing Classes:
AsmAttributeEnhancer

public interface AttributeEnhancer

Enhances a classes with attributes.

Author:
Jonas Bonér

Field Summary
static String CUSTOM_ATTRIBUTE
          The name of the AspectWerkz custom attributes.
 
Method Summary
 String[] getNearestInterfacesInHierarchy(String innerClassName)
          Return the first interfaces implemented by a level in the class hierarchy (bottom top).
 boolean initialize(String className, URL[] classPath)
          Initializes the attribute enhancer.
 void insertClassAttribute(Object attribute)
          Inserts an attribute on class level.
 void insertConstructorAttribute(com.thoughtworks.qdox.model.JavaMethod method, Object attribute)
          Inserts an attribute on constructor level.
 void insertFieldAttribute(com.thoughtworks.qdox.model.JavaField field, Object attribute)
          Inserts an attribute on field level.
 void insertMethodAttribute(com.thoughtworks.qdox.model.JavaMethod method, Object attribute)
          Inserts an attribute on method level.
 void write(String destDir)
          Writes the enhanced class to file.
 

Field Detail

CUSTOM_ATTRIBUTE

public static final String CUSTOM_ATTRIBUTE
The name of the AspectWerkz custom attributes.

See Also:
Constant Field Values
Method Detail

initialize

public boolean initialize(String className,
                          URL[] classPath)
Initializes the attribute enhancer.

Must always be called before use.

Parameters:
className - the class name
classPath - the class path
Returns:
true if the class was succefully loaded, false otherwise

insertClassAttribute

public void insertClassAttribute(Object attribute)
Inserts an attribute on class level.

Parameters:
attribute - the attribute

insertFieldAttribute

public void insertFieldAttribute(com.thoughtworks.qdox.model.JavaField field,
                                 Object attribute)
Inserts an attribute on field level.

Parameters:
field - the QDox java field
attribute - the attribute

insertConstructorAttribute

public void insertConstructorAttribute(com.thoughtworks.qdox.model.JavaMethod method,
                                       Object attribute)
Inserts an attribute on constructor level.

Parameters:
method - the QDox java method
attribute - the attribute

insertMethodAttribute

public void insertMethodAttribute(com.thoughtworks.qdox.model.JavaMethod method,
                                  Object attribute)
Inserts an attribute on method level.

Parameters:
method - the QDox java method
attribute - the attribute

write

public void write(String destDir)
Writes the enhanced class to file.

Parameters:
destDir - the destination directory

getNearestInterfacesInHierarchy

public String[] getNearestInterfacesInHierarchy(String innerClassName)
Return the first interfaces implemented by a level in the class hierarchy (bottom top).

Returns:
nearest superclass (including itself) ' implemented interfaces


Copyright © 2002-2004 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.