org.codehaus.aspectwerkz.pointcut
Class AbstractPointcut

java.lang.Object
  extended byorg.codehaus.aspectwerkz.pointcut.AbstractPointcut
Direct Known Subclasses:
ClassPointcut, ExecutionPointcut, ThrowsPointcut

public abstract class AbstractPointcut
extends java.lang.Object

Abstract implementation of the pointcut concept. I.e. an abstraction of a well defined point of execution in the program.
Could matches one or many as long at it is well defined.
Stores the advices for the specific pointcut.

Author:
Jonas Bonér

Constructor Summary
AbstractPointcut(java.lang.String uuid, Expression expression)
          Creates a new pointcut.
 
Method Summary
 void addAdvice(java.lang.String advice)
          Adds an advice to the pointcut.
 void addAdvices(java.lang.String[] advicesToAdd)
          Adds an array of advices to the pointcut.
Makes a defensive copy.
 IndexTuple getAdviceIndex(int index)
          Returns a specific advice index.
 IndexTuple[] getAdviceIndexes()
          Returns a list with the indexes for the advices for the pointcut.
 java.util.List getAdviceIndexTuples()
          Returns the advices in the form of an array with advice/index tuples.
 java.lang.String[] getAdviceNames()
          Returns a list with the names for the advices for the pointcut.
 java.lang.String getCFlowExpression()
          Returns the cflow expression.
 Expression getExpression()
          Returns the expression for the pointcut.
 boolean hasAdvice(java.lang.String advice)
          Checks if the pointcuts has a certain advice.
 void removeAdvice(java.lang.String advice)
          Removes an advice from the pointcut.
 void setAdviceIndexTuples(java.util.List advices)
          Sets the advices.
 void setCFlowExpression(java.lang.String cflowExpression)
          Sets the cflow expression.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPointcut

public AbstractPointcut(java.lang.String uuid,
                        Expression expression)
Creates a new pointcut.

Parameters:
uuid - the UUID for the AspectWerkz system
expression - the pattern for the pointcut
Method Detail

addAdvice

public void addAdvice(java.lang.String advice)
Adds an advice to the pointcut.

Parameters:
advice - the name of the advice to add

addAdvices

public void addAdvices(java.lang.String[] advicesToAdd)
Adds an array of advices to the pointcut.
Makes a defensive copy.

Parameters:
advicesToAdd - the name of the advices to add

removeAdvice

public void removeAdvice(java.lang.String advice)
Removes an advice from the pointcut.

Parameters:
advice - the name of the advice to remove

hasAdvice

public boolean hasAdvice(java.lang.String advice)
Checks if the pointcuts has a certain advice.

Parameters:
advice - the advice to check for existence
Returns:
boolean

getCFlowExpression

public java.lang.String getCFlowExpression()
Returns the cflow expression.

Returns:
the cflow expression

setCFlowExpression

public void setCFlowExpression(java.lang.String cflowExpression)
Sets the cflow expression.

Parameters:
cflowExpression - the cflow expression

getAdviceIndexTuples

public java.util.List getAdviceIndexTuples()
Returns the advices in the form of an array with advice/index tuples. To be used when a reordering of the advices is necessary.
For addition of an advice see addAdviceTestMethod(..).
For removal of an advice see removeAdviceTestMethod(..).

Returns:
the current advice/index tuples as a list

setAdviceIndexTuples

public void setAdviceIndexTuples(java.util.List advices)
Sets the advices. To be used when a reordering of the advices is necessary.
For addition of an advice see addAdviceTestMethod(..).
For removal of an advice see removeAdviceTestMethod(..).

Parameters:
advices - the new advice/index tuple array

getAdviceIndex

public IndexTuple getAdviceIndex(int index)
Returns a specific advice index.

Returns:
the advice index

getAdviceIndexes

public IndexTuple[] getAdviceIndexes()
Returns a list with the indexes for the advices for the pointcut.

Returns:
the advices

getAdviceNames

public java.lang.String[] getAdviceNames()
Returns a list with the names for the advices for the pointcut.

Returns:
the advices

getExpression

public Expression getExpression()
Returns the expression for the pointcut.

Returns:
the expression


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