org.codehaus.aspectwerkz.pointcut
Class AbstractPointcut

java.lang.Object
  extended byorg.codehaus.aspectwerkz.pointcut.AbstractPointcut
All Implemented Interfaces:
Pointcut
Direct Known Subclasses:
MethodPointcut, ThrowsPointcut

public abstract class AbstractPointcut
extends java.lang.Object
implements Pointcut

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, java.lang.String pattern)
          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.
 int getAdviceIndex(int index)
          Returns a specific advice index.
 int[] 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 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.
 
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,
                        java.lang.String pattern)
Creates a new pointcut.

Parameters:
uuid - the UUID for the AspectWerkz system
pattern - 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

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 int getAdviceIndex(int index)
Returns a specific advice index.

Returns:
the advice index

getAdviceIndexes

public int[] 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 java.lang.String getExpression()
Returns the expression for the pointcut.

Specified by:
getExpression in interface Pointcut
Returns:
the expression


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