org.codehaus.aspectwerkz.attribdef.definition
Class AspectDefinition

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

public class AspectDefinition
extends java.lang.Object

Holds the meta-data for the aspect.

Author:
Jonas Bonér, Alexandre Vasseur

Constructor Summary
AspectDefinition(java.lang.String name, java.lang.String className, java.lang.String deploymentModel)
          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 addController(ControllerDefinition controllerDef)
          Adds a new controller definition.
 void addInterfaceIntroduction(InterfaceIntroductionDefinition interfaceIntroductionMetaData)
          Adds a new pure interface introduction.
 void addIntroduction(IntroductionDefinition introductionMetaData)
          Adds a new implementation introduction.
 void addParameter(java.lang.String name, java.lang.String value)
          Adds a new parameter to the advice.
 void addPointcut(PointcutDefinition pointcutDef)
          Adds a new pointcut definition.
 java.util.List getAfterAdvices()
          Returns the after advices.
 java.util.List getAllAdvices()
          Returns all the advices for this aspect.
 java.util.List getAroundAdvices()
          Returns the around advices.
 java.util.List getBeforeAdvices()
          Returns the before advices.
 java.lang.String getClassName()
          Returns the class name.
 java.util.Collection getControllers()
          Returns a list with the controllers.
 java.lang.String getDeploymentModel()
          Returns the deployment model.
 java.util.List getInterfaceIntroductions()
          Returns the interface introductions.
 java.util.List getIntroductions()
          Returns the implementation introductions.
 java.lang.String getName()
          Returns the pattern for the aspect
 java.util.Map getParameters()
          Returns the parameters as a Map.
 PointcutDefinition getPointcutDef(java.lang.String pointcutName)
          Returns a specific pointcut.
 java.util.Collection getPointcuts()
          Returns the pointcuts.
 void setName(java.lang.String name)
          Sets the name for the aspect.
static java.util.List sortAdvices(java.util.List advices)
          Sorts the advice by method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AspectDefinition

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

Parameters:
name - the name of the aspect
className - the class name of the aspect
deploymentModel - the deployment model
Method Detail

getName

public java.lang.String getName()
Returns the pattern for the aspect

Returns:
the pattern

setName

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

Parameters:
name - the name

getClassName

public java.lang.String getClassName()
Returns the class name.

Returns:
the class name

getDeploymentModel

public java.lang.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

getAroundAdvices

public java.util.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 java.util.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 java.util.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 java.util.List getInterfaceIntroductions()
Returns the interface introductions.

Returns:
the introductions

getIntroductions

public java.util.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 java.util.Collection getPointcuts()
Returns the pointcuts.

Returns:
the pointcuts

getPointcutDef

public PointcutDefinition getPointcutDef(java.lang.String pointcutName)
Returns a specific pointcut.

Parameters:
pointcutName - the pointcut name
Returns:
the pointcut definition

addParameter

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

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

getParameters

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

Returns:
the parameters

getControllers

public java.util.Collection getControllers()
Returns a list with the controllers.

Returns:
the controllers

addController

public void addController(ControllerDefinition controllerDef)
Adds a new controller definition.

Parameters:
controllerDef - a controller definition

getAllAdvices

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

Returns:
all the advices

sortAdvices

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

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


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