Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.aspectwerkz.definition
Class AdviceDefinition

    java.lang.Object
      org.codehaus.aspectwerkz.definition.AdviceDefinition

    public class AdviceDefinition

extends Object

Holds the meta-data for the advices.

Author:
  Jonas Boner

Constructor Summary
`AdviceDefinition(String name, AdviceType type, String specialArgumentType, String aspectName, String aspectClassName, ExpressionInfo expressionInfo, MethodInfo methodInfo, AspectDefinition aspectDef)` Creates a new advice meta-data instance.

Method Summary
`AdviceDefinition` | `copyAt(ExpressionInfo expressionInfo)` Deep copy of the definition.
`boolean` | `equals(Object o)` Equals and hashcode means we have the same advice if the aspect qualified name (not classname) and advice name (may include signature) are the same.
`String` | `getAspectClassName()` Returns the class name.
`AspectDefinition` | `getAspectDefinition()` Returns the definition for the aspect that defines this advice.
`String` | `getAspectName()` Returns the aspect name.
`String` | `getAttribute()` Returns the attribute.
`DeploymentModel` | `getDeploymentModel()` Returns the the deployment model for the advice
`ExpressionInfo` | `getExpressionInfo()` Returns the expression.
`MethodInfo` | `getMethodInfo()` Returns the method.
`String` | `getName()` Returns the name of the advice.
`String` | `getQualifiedName()` Returns the fully qualified name for the advice
`String` | `getSpecialArgumentType()` Returns the special arg type, such as returning(TYPE) or throwing(TYPE).
`AdviceType` | `getType()` Returns the advice type.
`boolean` | `hasCflowOrCflowBelow()` Check if the advice is bound to a pointcut with cflow or cflowbelow
`int` | `hashCode()`
`static AdviceDefinition` | `newInstance(String adviceName, AdviceType adviceType, String expression, String specialArgumentType, String aspectName, String aspectClassName, MethodInfo method, AspectDefinition aspectDef)` TODO only use this method and make ctor private?
`void` | `setAttribute(String attribute)` Sets the attribute.
`void` | `setExpressionInfo(ExpressionInfo newExpression)` Sets the expression info.
`void` | `setName(String name)` Sets the name of the advice.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AdviceDefinition

    public AdviceDefinition(String name,
                            AdviceType type,
                            String specialArgumentType,
                            String aspectName,
                            String aspectClassName,
                            ExpressionInfo expressionInfo,
                            MethodInfo methodInfo,
                            AspectDefinition aspectDef)

  Creates a new advice meta-data instance.

  Parameters:
    `name` - the name of the expressionInfo
    `type` - the type of the advice
    `specialArgumentType` - the special arg type, such as returning(TYPE) or throwing(TYPE)
    `aspectName` - the name of the aspect
    `aspectClassName` - the class name of the aspect
    `expressionInfo` - the expressionInfo
    `methodInfo` - the methodInfo

Method Detail

### newInstance

    public static AdviceDefinition newInstance(String adviceName,
                                               AdviceType adviceType,
                                               String expression,
                                               String specialArgumentType,
                                               String aspectName,
                                               String aspectClassName,
                                               MethodInfo method,
                                               AspectDefinition aspectDef)

  TODO only use this method and make ctor private?

  Creates a new advice definition.

  Parameters:
    `adviceName` - the advice name
    `adviceType` - the advice type
    `expression` - the advice expression
    `specialArgumentType` - the arg
    `aspectName` - the aspect name
    `aspectClassName` - the aspect class name
    `method` - the advice method
    `aspectDef` - the aspect definition
  Returns:
    the new advice definition

### getType

    public AdviceType getType()

  Returns the advice type.

  Returns:
    the advice type

### getName

    public String getName()

  Returns the name of the advice.

  Returns:
    the name

### getQualifiedName

    public String getQualifiedName()

  Returns the fully qualified name for the advice

  Returns:
    the fully qualified name

### setName

    public void setName(String name)

  Sets the name of the advice.

  Parameters:
    `name` - the name

### getExpressionInfo

    public ExpressionInfo getExpressionInfo()

  Returns the expression.

  TODO should return NULL object if null

  Returns:
    the expression

### setExpressionInfo

    public void setExpressionInfo(ExpressionInfo newExpression)

  Sets the expression info.

  Parameters:
    `newExpression` - the new expression info

### getAspectClassName

    public String getAspectClassName()

  Returns the class name.

  Returns:
    the class name

### getAspectName

    public String getAspectName()

  Returns the aspect name.

  Returns:
    the aspect name

### getSpecialArgumentType

    public String getSpecialArgumentType()

  Returns the special arg type, such as returning(TYPE) or throwing(TYPE).

  Returns:

### getMethodInfo

    public MethodInfo getMethodInfo()

  Returns the method.

  Returns:
    the method

### getDeploymentModel

    public DeploymentModel getDeploymentModel()

  Returns the the deployment model for the advice

  Returns:
    the deployment model

### getAttribute

    public String getAttribute()

  Returns the attribute.

  Returns:
    the attribute

### setAttribute

    public void setAttribute(String attribute)

  Sets the attribute.

  Parameters:
    `attribute` - the attribute

### getAspectDefinition

    public AspectDefinition getAspectDefinition()

  Returns the definition for the aspect that defines this advice.

  Returns:
    the aspect definition

### hasCflowOrCflowBelow

    public boolean hasCflowOrCflowBelow()

  Check if the advice is bound to a pointcut with cflow or cflowbelow

  Returns:

### copyAt

    public AdviceDefinition copyAt(ExpressionInfo expressionInfo)

  Deep copy of the definition.

  Parameters:
    `expressionInfo` -
  Returns:

### equals

    public boolean equals(Object o)

  Equals and hashcode means we have the same advice if the aspect qualified name (not classname) and advice name (may include signature) are the same. [AW-439 fix]

  Overrides:
    `equals` in class `Object`
  Parameters:
    `o` -
  Returns:

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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