org.codehaus.aspectwerkz
Class Aspect

java.lang.Object
  extended byorg.codehaus.aspectwerkz.Aspect

public class Aspect
extends java.lang.Object

Implements the Aspect concept. Manages pointcuts and introductions for a defined by this aspect.

Author:
Jonas Bonér

Constructor Summary
Aspect(java.lang.String name)
          Creates a new aspect.
Aspect(java.lang.String uuid, java.lang.String name)
          Creates a new aspect.
 
Method Summary
 void addCallerSidePointcut(CallerSidePointcut callerSidePointcut)
          Adds a new caller side pointcut to the class.
 void addCallerSidePointcuts(CallerSidePointcut[] callerSidePointcuts)
          Adds an array with new caller side pointcuts to the class.
 void addGetFieldPointcut(FieldPointcut fieldPointcut)
          Adds a new get field pointcut to the class.
 void addGetFieldPointcuts(FieldPointcut[] fieldPointcuts)
          Adds an array with new get field pointcuts to the class.
 void addIntroduction(java.lang.String introduction)
          Adds an introduction to the open class.
 void addIntroductions(java.lang.String[] introductions)
          Adds an array with introductions to the open class.
 void addMethodPointcut(MethodPointcut methodPointcut)
          Adds a new method pointcut to the class.
 void addMethodPointcuts(MethodPointcut[] methodPointcuts)
          Adds a new method pointcuts to the class.
 void addMethodToCFlowMethodMap(PointcutPatternTuple patternTuple, PointcutPatternTuple cflowPatternTuple)
          Adds a new method pattern to the method->cflow-method map.
 void addSetFieldPointcut(FieldPointcut fieldPointcut)
          Adds a new set field pointcut to the class.
 void addSetFieldPointcuts(FieldPointcut[] fieldPointcuts)
          Adds an array with new set field pointcuts to the class.
 void addThrowsPointcut(ThrowsPointcut throwsPointcut)
          Adds a new throws pointcut to the class.
 void addThrowsPointcuts(ThrowsPointcut[] throwsPointcuts)
          Adds an array with new throws pointcuts to the class.
 CallerSidePointcut createCallerSidePointcut(java.lang.String pattern)
          Creates a new caller side pointcut for the method specified.
 FieldPointcut createGetFieldPointcut(java.lang.String pattern)
          Creates a new pointcut for the field specified.
 MethodPointcut createMethodPointcut(java.lang.String pattern)
          Creates a new pointcut for the method join point specified.
 FieldPointcut createSetFieldPointcut(java.lang.String pattern)
          Creates a new pointcut for the set field join point specified.
 ThrowsPointcut createThrowsPointcut(java.lang.String pattern)
          Creates a new throws pointcut for the method and exception specified.
 boolean equals(java.lang.Object o)
           
 java.util.List getCallerSidePointcuts(java.lang.String className, MethodMetaData methodMetaData)
          Returns all the pointcuts for the caller side join point specified.
 java.util.List getCFlowPointcuts(java.lang.String className, MethodMetaData methodMetaData)
          Returns all the pointcuts for the cflow join point specified.
 java.util.List getGetFieldPointcuts(ClassMetaData classMetaData, FieldMetaData fieldMetaData)
          Returns all the pointcuts for the method join point specified.
 java.lang.String[] getIntroductions()
          Returns the introductions for the open class.
 java.util.List getMethodPointcuts(ClassMetaData classMetaData, MethodMetaData methodMetaData)
          Returns all the pointcuts for the method join point specified.
 java.lang.String getName()
          Returns the name of the aspect.
 java.util.List getSetFieldPointcuts(ClassMetaData classMetaData, FieldMetaData fieldMetaData)
          Returns all the pointcuts for the method join point specified.
 java.util.List getThrowsPointcuts(ClassMetaData classMetaData, MethodMetaData methodMetaData)
          Returns the pointcut for the method/exception join point specified.
 int hashCode()
           
 boolean hasThrowsPointcut(ClassMetaData classMetaData, MethodMetaData methodMetaData, java.lang.String exception)
          Checks if a specific method/exceptoin join point has a specific throws pointcut configured.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Aspect

public Aspect(java.lang.String name)
Creates a new aspect.

Parameters:
name - the name of the aspect

Aspect

public Aspect(java.lang.String uuid,
              java.lang.String name)
Creates a new aspect.

Parameters:
uuid - the UUID for the AspectWerkz system
name - the name of the aspect
Method Detail

getName

public java.lang.String getName()
Returns the name of the aspect.

Returns:
the aspect name

createMethodPointcut

public MethodPointcut createMethodPointcut(java.lang.String pattern)
Creates a new pointcut for the method join point specified.

Parameters:
pattern - the pattern
Returns:
the pointcut

createGetFieldPointcut

public FieldPointcut createGetFieldPointcut(java.lang.String pattern)
Creates a new pointcut for the field specified.

Parameters:
pattern - the pattern
Returns:
the pointcut

createSetFieldPointcut

public FieldPointcut createSetFieldPointcut(java.lang.String pattern)
Creates a new pointcut for the set field join point specified.

Parameters:
pattern - the pattern
Returns:
the pointcut

createThrowsPointcut

public ThrowsPointcut createThrowsPointcut(java.lang.String pattern)
Creates a new throws pointcut for the method and exception specified.

Parameters:
pattern - the pattern
Returns:
the pointcut

createCallerSidePointcut

public CallerSidePointcut createCallerSidePointcut(java.lang.String pattern)
Creates a new caller side pointcut for the method specified.

Parameters:
pattern - the pattern
Returns:
the pointcut

addIntroduction

public final void addIntroduction(java.lang.String introduction)
Adds an introduction to the open class.

Parameters:
introduction - the name of the introduction to add

addIntroductions

public final void addIntroductions(java.lang.String[] introductions)
Adds an array with introductions to the open class.

Parameters:
introductions - the introductions to add

addMethodPointcut

public void addMethodPointcut(MethodPointcut methodPointcut)
Adds a new method pointcut to the class.

Parameters:
methodPointcut - the method pointcut to add

addMethodPointcuts

public void addMethodPointcuts(MethodPointcut[] methodPointcuts)
Adds a new method pointcuts to the class.

Parameters:
methodPointcuts - an arrayt with the method pointcut to add

addThrowsPointcut

public void addThrowsPointcut(ThrowsPointcut throwsPointcut)
Adds a new throws pointcut to the class.

Parameters:
throwsPointcut - the throws pointcut to add

addThrowsPointcuts

public void addThrowsPointcuts(ThrowsPointcut[] throwsPointcuts)
Adds an array with new throws pointcuts to the class.

Parameters:
throwsPointcuts - the throws pointcuts to add

addGetFieldPointcut

public final void addGetFieldPointcut(FieldPointcut fieldPointcut)
Adds a new get field pointcut to the class.

Parameters:
fieldPointcut - the field pointcut to add

addGetFieldPointcuts

public void addGetFieldPointcuts(FieldPointcut[] fieldPointcuts)
Adds an array with new get field pointcuts to the class.

Parameters:
fieldPointcuts - the field pointcuts to add

addSetFieldPointcut

public void addSetFieldPointcut(FieldPointcut fieldPointcut)
Adds a new set field pointcut to the class.

Parameters:
fieldPointcut - the field pointcut to add

addSetFieldPointcuts

public void addSetFieldPointcuts(FieldPointcut[] fieldPointcuts)
Adds an array with new set field pointcuts to the class.

Parameters:
fieldPointcuts - the field pointcuts to add

addCallerSidePointcut

public final void addCallerSidePointcut(CallerSidePointcut callerSidePointcut)
Adds a new caller side pointcut to the class.

Parameters:
callerSidePointcut - the caller side pointcut to add

addCallerSidePointcuts

public final void addCallerSidePointcuts(CallerSidePointcut[] callerSidePointcuts)
Adds an array with new caller side pointcuts to the class.

Parameters:
callerSidePointcuts - the caller side pointcuts to add

addMethodToCFlowMethodMap

public void addMethodToCFlowMethodMap(PointcutPatternTuple patternTuple,
                                      PointcutPatternTuple cflowPatternTuple)
Adds a new method pattern to the method->cflow-method map.

Parameters:
patternTuple - the method pointcut definition
cflowPatternTuple - the cflow pointcut definition

getIntroductions

public java.lang.String[] getIntroductions()
Returns the introductions for the open class.

Returns:
an array with the introductions for the class

getMethodPointcuts

public java.util.List getMethodPointcuts(ClassMetaData classMetaData,
                                         MethodMetaData methodMetaData)
Returns all the pointcuts for the method join point specified.

Parameters:
classMetaData - the meta-data for the class
methodMetaData - the meta-data for the method
Returns:
the pointcuts

getGetFieldPointcuts

public java.util.List getGetFieldPointcuts(ClassMetaData classMetaData,
                                           FieldMetaData fieldMetaData)
Returns all the pointcuts for the method join point specified.

Parameters:
classMetaData - the meta-data for the class
fieldMetaData - the meta-data for the field
Returns:
the pointcuts

getSetFieldPointcuts

public java.util.List getSetFieldPointcuts(ClassMetaData classMetaData,
                                           FieldMetaData fieldMetaData)
Returns all the pointcuts for the method join point specified.

Parameters:
classMetaData - the meta-data for the class
fieldMetaData - the meta-data for the field
Returns:
the pointcuts

getThrowsPointcuts

public java.util.List getThrowsPointcuts(ClassMetaData classMetaData,
                                         MethodMetaData methodMetaData)
Returns the pointcut for the method/exception join point specified.

Parameters:
classMetaData - the meta-data for the class
methodMetaData - the method meta-data
Returns:
the pointcut

getCallerSidePointcuts

public java.util.List getCallerSidePointcuts(java.lang.String className,
                                             MethodMetaData methodMetaData)
Returns all the pointcuts for the caller side join point specified.

Parameters:
className - the class name
methodMetaData - the meta-data for the method
Returns:
the pointcuts

getCFlowPointcuts

public java.util.List getCFlowPointcuts(java.lang.String className,
                                        MethodMetaData methodMetaData)
Returns all the pointcuts for the cflow join point specified.

Parameters:
className - the name of the class
methodMetaData - the meta-data for the method
Returns:
the pointcuts

hasThrowsPointcut

public boolean hasThrowsPointcut(ClassMetaData classMetaData,
                                 MethodMetaData methodMetaData,
                                 java.lang.String exception)
Checks if a specific method/exceptoin join point has a specific throws pointcut configured.

Parameters:
classMetaData - the meta-data for the class
methodMetaData - the meta-data for the method
exception - the name pattern of the exception
Returns:
boolean

toString

public java.lang.String toString()

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)


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