org.codehaus.aspectwerkz
Class AspectMetaData

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

public class AspectMetaData
extends java.lang.Object

Manages pointcuts and introductions defined by this aspect.

Author:
Jonas Bonér, Alexandre Vasseur

Constructor Summary
AspectMetaData(java.lang.String uuid, java.lang.String name)
          Creates a new aspect.
AspectMetaData(java.lang.String uuid, java.lang.String name, int deploymentModel)
          Creates a new aspect.
 
Method Summary
 void addCallPointcut(CallPointcut pointcut)
          Adds a new call pointcut to the class.
 void addExecutionPointcut(ExecutionPointcut pointcut)
          Adds a new execution pointcut to the class.
 void addGetPointcut(GetPointcut pointcut)
          Adds a new get pointcut 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 addMethodToCflowExpressionMap(Expression expression, Expression cflowExpression)
          Adds a Execution expression to execution expr.->cflow call expr.
 void addSetPointcut(SetPointcut pointcut)
          Adds a new set pointcut to the class.
 void addThrowsPointcut(ThrowsPointcut pointcut)
          Adds a new throws pointcut to the class.
 boolean equals(java.lang.Object o)
           
 CallPointcut getCallPointcut(java.lang.String expression)
          Returns the call pointcut for a specific uuid and expression.
 java.util.List getCallPointcuts(ClassMetaData classMetaData, MethodMetaData methodMetaData)
          Returns all the pointcuts for the caller side join point specified.
 java.util.List getCFlowExpressions(ClassMetaData classMetaData, MethodMetaData methodMetaData)
          Returns all the cflow call expression for the given metadata (callee side)
 int getDeploymentModel()
          Returns the deployment model for the aspect.
 java.lang.String getDeploymentModelAsString()
          Returns the deployment model for the aspect.
 ExecutionPointcut getExecutionPointcut(java.lang.String expression)
          Returns the execution pointcut for a specific uuid and expression.
 java.util.List getExecutionPointcuts(ClassMetaData classMetaData, MethodMetaData methodMetaData)
          Returns all the pointcuts for the method join point specified.
 GetPointcut getGetPointcut(java.lang.String expression)
          Returns the get pointcut for a specific uuid and expression.
 java.util.List getGetPointcuts(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.lang.String getName()
          Returns the name of the aspect.
 SetPointcut getSetPointcut(java.lang.String expression)
          Returns the set pointcut for a specific uuid and expression.
 java.util.List getSetPointcuts(ClassMetaData classMetaData, FieldMetaData fieldMetaData)
          Returns all the pointcuts for the method join point specified.
 ThrowsPointcut getThrowsPointcut(java.lang.String expression)
          Returns the throws pointcut for a specific uuid and expression.
 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

AspectMetaData

public AspectMetaData(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

AspectMetaData

public AspectMetaData(java.lang.String uuid,
                      java.lang.String name,
                      int deploymentModel)
Creates a new aspect.

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

getName

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

Returns:
the aspect name

getDeploymentModel

public int getDeploymentModel()
Returns the deployment model for the aspect.

Returns:
the deployment model

getDeploymentModelAsString

public java.lang.String getDeploymentModelAsString()
Returns the deployment model for the aspect.

Returns:
the deployment model

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

addExecutionPointcut

public void addExecutionPointcut(ExecutionPointcut pointcut)
Adds a new execution pointcut to the class.

Parameters:
pointcut - the pointcut to add

addThrowsPointcut

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

Parameters:
pointcut - the pointcut to add

addGetPointcut

public final void addGetPointcut(GetPointcut pointcut)
Adds a new get pointcut to the class.

Parameters:
pointcut - the pointcut to add

addSetPointcut

public void addSetPointcut(SetPointcut pointcut)
Adds a new set pointcut to the class.

Parameters:
pointcut - the pointcut to add

addCallPointcut

public final void addCallPointcut(CallPointcut pointcut)
Adds a new call pointcut to the class.

Parameters:
pointcut - the pointcut to add

addMethodToCflowExpressionMap

public void addMethodToCflowExpressionMap(Expression expression,
                                          Expression cflowExpression)
Adds a Execution expression to execution expr.->cflow call expr. map.

Parameters:
expression - the execution expression
cflowExpression - the cflow call expression

getIntroductions

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

Returns:
an array with the introductions for the class

getExecutionPointcut

public ExecutionPointcut getExecutionPointcut(java.lang.String expression)
Returns the execution pointcut for a specific uuid and expression.

Parameters:
expression - the expression
Returns:
the execution pointcut

getExecutionPointcuts

public java.util.List getExecutionPointcuts(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

getGetPointcut

public GetPointcut getGetPointcut(java.lang.String expression)
Returns the get pointcut for a specific uuid and expression.

Parameters:
expression - the expression
Returns:
the get pointcut

getGetPointcuts

public java.util.List getGetPointcuts(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

getSetPointcut

public SetPointcut getSetPointcut(java.lang.String expression)
Returns the set pointcut for a specific uuid and expression.

Parameters:
expression - the expression
Returns:
the method pointcut

getSetPointcuts

public java.util.List getSetPointcuts(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

getThrowsPointcut

public ThrowsPointcut getThrowsPointcut(java.lang.String expression)
Returns the throws pointcut for a specific uuid and expression.

Parameters:
expression - the expression
Returns:
the method pointcut

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

getCallPointcut

public CallPointcut getCallPointcut(java.lang.String expression)
Returns the call pointcut for a specific uuid and expression.

Parameters:
expression - the expression
Returns:
the call pointcut

getCallPointcuts

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

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

getCFlowExpressions

public java.util.List getCFlowExpressions(ClassMetaData classMetaData,
                                          MethodMetaData methodMetaData)
Returns all the cflow call expression for the given metadata (callee side)

Parameters:
classMetaData - 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.