org.codehaus.aspectwerkz.definition
Class AspectDefinition

java.lang.Object
  extended byorg.codehaus.aspectwerkz.definition.AspectDefinition

public class AspectDefinition
extends Object

Holds the meta-data for the aspect.

Author:
Jonas Bonér , Alexandre Vasseur

Constructor Summary
AspectDefinition(String name, String className, String uuid)
          Creates a new aspect meta-data instance.
 
Method Summary
 void addAfterAdvice(AdviceDefinition adviceMetaData)
          Adds a new after advice.
 void addAroundAdvice(AdviceDefinition adviceMetaData)
          Adds a new around advice.
 void addBeforeAdvice(AdviceDefinition adviceMetaData)
          Adds a new before advice.
 void addInterfaceIntroduction(InterfaceIntroductionDefinition interfaceIntroductionMetaData)
          Adds a new pure interface introduction.
 void addIntroduction(IntroductionDefinition introductionMetaData)
          Adds a new implementation introduction.
 void addParameter(String name, String value)
          Adds a new parameter to the advice.
 void addPointcut(PointcutDefinition pointcutDef)
          Adds a new pointcut definition.
 List getAfterAdvices()
          Returns the after advices.
 List getAllAdvices()
          Returns all the advices for this aspect.
 List getAroundAdvices()
          Returns the around advices.
 List getBeforeAdvices()
          Returns the before advices.
 String getClassName()
          Returns the class name.
 String getContainerClassName()
          Returns the name of the container implementation class.
 String getDeploymentModel()
          Returns the deployment model.
 String getFullQualifiedName()
          Returns the pattern for the aspect
 List getInterfaceIntroductions()
          Returns the interface introductions.
 List getIntroductions()
          Returns the implementation introductions.
 String getName()
          Returns the pattern for the aspect
 Map getParameters()
          Returns the parameters as a Map.
 Collection getPointcuts()
          Returns the pointcuts.
 void removeAroundAdvice(AdviceDefinition adviceMetaData)
          Remove an around advice.
 void setContainerClassName(String containerClassName)
          Sets the name of the container implementation class.
 void setDeploymentModel(String deploymentModel)
          Sets the deployment model.
 void setName(String name)
          Sets the name for the aspect.
static List sortAdvices(List advices)
          Sorts the advice by method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AspectDefinition

public AspectDefinition(String name,
                        String className,
                        String uuid)
Creates a new aspect meta-data instance.

Parameters:
name - the name of the aspect
className - the class name of the aspect
Method Detail

getName

public String getName()
Returns the pattern for the aspect

Returns:
the pattern

getFullQualifiedName

public String getFullQualifiedName()
Returns the pattern for the aspect

Returns:
the pattern

setName

public void setName(String name)
Sets the name for the aspect.

Parameters:
name - the name

getClassName

public String getClassName()
Returns the class name.

Returns:
the class name

setDeploymentModel

public void setDeploymentModel(String deploymentModel)
Sets the deployment model.

Parameters:
deploymentModel - the deployment model

getDeploymentModel

public String getDeploymentModel()
Returns the deployment model.

Returns:
the deployment model

addAroundAdvice

public void addAroundAdvice(AdviceDefinition adviceMetaData)
Adds a new around advice.

Parameters:
adviceMetaData - the around advice

removeAroundAdvice

public void removeAroundAdvice(AdviceDefinition adviceMetaData)
Remove an around advice. Experimental

Parameters:
adviceMetaData - the around advice

getAroundAdvices

public List getAroundAdvices()
Returns the around advices.

Returns:
the around advices

addBeforeAdvice

public void addBeforeAdvice(AdviceDefinition adviceMetaData)
Adds a new before advice.

Parameters:
adviceMetaData - the before advice

getBeforeAdvices

public List getBeforeAdvices()
Returns the before advices.

Returns:
the before advices

addAfterAdvice

public void addAfterAdvice(AdviceDefinition adviceMetaData)
Adds a new after advice.

Parameters:
adviceMetaData - the after advice

getAfterAdvices

public List getAfterAdvices()
Returns the after advices.

Returns:
the after advices

addInterfaceIntroduction

public void addInterfaceIntroduction(InterfaceIntroductionDefinition interfaceIntroductionMetaData)
Adds a new pure interface introduction.

Parameters:
interfaceIntroductionMetaData - the introduction

addIntroduction

public void addIntroduction(IntroductionDefinition introductionMetaData)
Adds a new implementation introduction.

Parameters:
introductionMetaData - the introduction

getInterfaceIntroductions

public List getInterfaceIntroductions()
Returns the interface introductions.

Returns:
the introductions

getIntroductions

public List getIntroductions()
Returns the implementation introductions.

Returns:
the introductions

addPointcut

public void addPointcut(PointcutDefinition pointcutDef)
Adds a new pointcut definition.

Parameters:
pointcutDef - the pointcut definition

getPointcuts

public Collection getPointcuts()
Returns the pointcuts.

Returns:
the pointcuts

addParameter

public void addParameter(String name,
                         String value)
Adds a new parameter to the advice.

Parameters:
name - the name of the parameter
value - the value for the parameter

getParameters

public Map getParameters()
Returns the parameters as a Map.

Returns:
the parameters

setContainerClassName

public void setContainerClassName(String containerClassName)
Sets the name of the container implementation class.

Parameters:
containerClassName - the container class name

getContainerClassName

public String getContainerClassName()
Returns the name of the container implementation class.

Returns:
the container class name

getAllAdvices

public List getAllAdvices()
Returns all the advices for this aspect.

Returns:
all the advices

sortAdvices

public static List sortAdvices(List advices)
Sorts the advice by method.

Parameters:
advices - a list with the advices to sort
Returns:
a sorted list with the advices


Copyright © 2002-2004 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.