org.codehaus.aspectwerkz.pointcut
Class SetPointcut

java.lang.Object
  extended byorg.codehaus.aspectwerkz.pointcut.SetPointcut

public class SetPointcut
extends java.lang.Object

Implements the pointcut concept for field access. Is an abstraction of a well defined point of execution in the program.
Could matches one or many points as long as they are well defined.
Stores the advices for this specific pointcut.

Author:
Jonas Bonér

Constructor Summary
SetPointcut(java.lang.String uuid, Expression expression)
          Creates a set pointcut.
 
Method Summary
 void addAfterAdvice(java.lang.String advice)
          Adds post advice to the pointcut.
 void addBeforeAdvice(java.lang.String advice)
          Adds a pre advice to the pointcut.
 void addPointcutDef(PointcutDefinition pointcut)
          Adds a new pointcut definition.
 void addPostAdvices(java.lang.String[] advicesToAdd)
          Adds post advices to the pointcut.
 void addPreAdvices(java.lang.String[] advicesToAdd)
          Adds pre advices to the pointcut.
 java.lang.String getCFlowExpression()
          Returns the cflow expression.
 Expression getExpression()
          Returns the expression of the pointcut.
 IndexTuple[] getPostAdviceIndexes()
          Returns a list with the indexes for the post advices for the pointcut.
 NameIndexTuple[] getPostAdviceIndexTuples()
          Returns the advices in the form of an array with advice/index tuples.
 java.lang.String[] getPostAdviceNames()
          Returns a list with the names for the post advices for the pointcut.
 IndexTuple[] getPreAdviceIndexes()
          Returns a list with the indexes for the pre advices for the pointcut.
 NameIndexTuple[] getPreAdviceIndexTuples()
          Returns the advices in the form of an array with advice/index tuples.
 java.lang.String[] getPreAdviceNames()
          Returns a list with the names for the pre advices for the pointcut.
 boolean hasPostAdvice(java.lang.String advice)
          Checks if the pointcuts has a certain post advice.
 boolean hasPreAdvice(java.lang.String advice)
          Checks if the pointcuts has a certain pre advice.
 void removePostAdvice(java.lang.String advice)
          Removes a post advice from the pointcut.
 void removePreAdvice(java.lang.String advice)
          Removes a pre advice from the pointcut.
 void setCFlowExpression(java.lang.String cflowExpression)
          Sets the cflow expression.
 void setPostAdviceIndexTuples(NameIndexTuple[] tuple)
          Sets the advices.
 void setPostAdvices(IndexTuple[] indexes, java.lang.String[] names)
          Sets the post advices.
 void setPreAdviceIndexTuples(NameIndexTuple[] tuple)
          Sets the advices.
 void setPreAdvices(IndexTuple[] indexes, java.lang.String[] names)
          Sets the pre advices.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetPointcut

public SetPointcut(java.lang.String uuid,
                   Expression expression)
Creates a set pointcut.

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

addPointcutDef

public void addPointcutDef(PointcutDefinition pointcut)
Adds a new pointcut definition.

Parameters:
pointcut - the pointcut definition

addBeforeAdvice

public void addBeforeAdvice(java.lang.String advice)
Adds a pre advice to the pointcut.

Parameters:
advice - the name of the advice to add

addAfterAdvice

public void addAfterAdvice(java.lang.String advice)
Adds post advice to the pointcut.

Parameters:
advice - the name of the advice to add

addPreAdvices

public void addPreAdvices(java.lang.String[] advicesToAdd)
Adds pre advices to the pointcut.

Parameters:
advicesToAdd - the advices to add

addPostAdvices

public void addPostAdvices(java.lang.String[] advicesToAdd)
Adds post advices to the pointcut.

Parameters:
advicesToAdd - the advices to add

removePreAdvice

public void removePreAdvice(java.lang.String advice)
Removes a pre advice from the pointcut.

Parameters:
advice - the name of the pre advice to remove

removePostAdvice

public void removePostAdvice(java.lang.String advice)
Removes a post advice from the pointcut.

Parameters:
advice - the name of the pre advice to remove

hasPreAdvice

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

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

hasPostAdvice

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

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

getPreAdviceIndexTuples

public NameIndexTuple[] getPreAdviceIndexTuples()
Returns the advices in the form of an array with advice/index tuples. To be used when a reordering of the advices is necessary.

Returns:
the current advice/index tuple array

setPreAdviceIndexTuples

public void setPreAdviceIndexTuples(NameIndexTuple[] tuple)
Sets the advices. To be used when a reordering of the advices is necessary.

Parameters:
tuple - the new advice/index tuple array

getPostAdviceIndexTuples

public NameIndexTuple[] getPostAdviceIndexTuples()
Returns the advices in the form of an array with advice/index tuples. To be used when a reordering of the advices is necessary.

Returns:
the current advice/index tuple array

setPostAdviceIndexTuples

public void setPostAdviceIndexTuples(NameIndexTuple[] tuple)
Sets the advices. To be used when a reordering of the advices is necessary.

Parameters:
tuple - the new advice/index tuple array

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

getPreAdviceIndexes

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

Returns:
the pre advice indexes

getPreAdviceNames

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

Returns:
the pre advice names

getPostAdviceIndexes

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

Returns:
the pre advice indexes

getPostAdviceNames

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

Returns:
the post advice names

getExpression

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

Returns:
the expression

setPreAdvices

public void setPreAdvices(IndexTuple[] indexes,
                          java.lang.String[] names)
Sets the pre advices. Caution: the index A name arrays have to be in synch.

Parameters:
indexes - the new pre advice index array
names - the new pre advice names array

setPostAdvices

public void setPostAdvices(IndexTuple[] indexes,
                           java.lang.String[] names)
Sets the post advices. Caution: the index A name arrays have to be in synch.

Parameters:
indexes - the new post advice index array
names - the new post advice names array


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