Top Fields Constructors Methods
org.aspectj.weaver

public abstract Class Advice

extends ShadowMunger
Class Inheritance
Known Direct Subclasses
org.aspectj.weaver.bcel.BcelAdvice
Imports
java.util.Collections, .List, org.aspectj.bridge.IMessage, .ISourceLocation, org.aspectj.weaver.patterns.AndPointcut, .PerClause, .Pointcut, .TypePattern

Field Summary

Modifier and TypeField and Description
protected AjAttribute.AdviceAttribute
protected UnresolvedType[]
protected ResolvedType
public static final int
public static final int
protected TypePattern
public static final int
private volatile int
protected boolean
protected List<ShadowMunger>
private boolean
protected transient AdviceKind
public ISourceLocation
protected int
public static final int
protected Member
protected List<Lint.Kind>
public static final int
public static final int
public static final int
public static final int
Inherited from org.aspectj.weaver.ShadowMunger:
endhandleNONEpointcutShadowMungerAdviceShadowMungerDeowsourceContextstart

Constructor Summary

AccessConstructor and Description
public
Advice(AjAttribute.AdviceAttribute attribute, Pointcut pointcut, Member signature)

Method Summary

Modifier and TypeMethod and Description
public ShadowMunger
concretize(ResolvedType
is guaranteed to be a non-abstract aspect
fromType
,
World world, PerClause
has been concretized at a higher level
clause
)

Implements abstract org.aspectj.weaver.ShadowMunger.concretize.

public static int
countOnes(int bits)

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
protected String
public int
public String[]
public UnresolvedType[]
public ResolvedType
public UnresolvedType
protected int
protected int
public UnresolvedType

Returns:

the type of the extraParameter
getExtraParameterType
()

Return the type of the 'extra argument'.

public AdviceKind
protected Member
public Pointcut
public Member
public abstract boolean
public boolean
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
public boolean
public boolean
public static Advice
makeCflowEntry(World world, Pointcut entry, boolean isBelow, Member stackField, int nFreeVars, List<ShadowMunger> innerCflowEntries, ResolvedType inAspect)

public static Advice
makePerCflowEntry(World world, Pointcut entry, boolean isBelow, Member stackField, ResolvedType inAspect, List<ShadowMunger> innerCflowEntries)

public static Advice
makePerObjectEntry(World world, Pointcut entry, boolean isThis, ResolvedType inAspect)

public static Advice
public static Advice
makeSoftener(World world, Pointcut entry, TypePattern exceptionType, ResolvedType inAspect, IHasSourceLocation loc)

public boolean
match(Shadow shadow, World world)

Overrides org.aspectj.weaver.ShadowMunger.match.

All overriding methods should call super
private void
maybeIssueUncheckedMatchWarning(ResolvedType
the type in the after returning declaration
afterReturningType
,
ResolvedType
the type at the shadow
shadowReturnType
,
Shadow shadow, World world)

In after returning advice if we are binding the extra parameter to a parameterized type we may not be able to do a type-safe conversion.

public void
public void
setHasMatchedSomething(boolean hasMatchedSomething)

public void
setLexicalPosition(int lexicalPosition)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.aspectj.weaver.ShadowMunger:
bindsProceedingJoinPointfallbackCompareTogetBinarySourceLocationgetDeclaringTypegetEndgetSourceLocationgetStartgetThrownExceptionsimplementOnisBinarymustCheckExceptionsparameterizeWithsetDeclaringTypesetPointcutspecializeOnwrite

Field Detail

attributeback to summary
protected AjAttribute.AdviceAttribute attribute
bindingParameterTypesback to summary
protected UnresolvedType[] bindingParameterTypes
concreteAspectback to summary
protected ResolvedType concreteAspect
ConstantReferenceback to summary
public static final int ConstantReference
ConstantValueback to summary
public static final int ConstantValue
exceptionTypeback to summary
protected TypePattern exceptionType
ExtraArgumentback to summary
public static final int ExtraArgument
hashCodeback to summary
private volatile int hashCode
hasMatchedAtLeastOnceback to summary
protected boolean hasMatchedAtLeastOnce
innerCflowEntriesback to summary
protected List<ShadowMunger> innerCflowEntries
isAnnotationStyleback to summary
private boolean isAnnotationStyle
kindback to summary
protected transient AdviceKind kind
lastReportedMonitorExitJoinpointLocationback to summary
public ISourceLocation lastReportedMonitorExitJoinpointLocation
nFreeVarsback to summary
protected int nFreeVars
ParameterMaskback to summary
public static final int ParameterMask
signatureback to summary
protected Member signature
suppressedLintKindsback to summary
protected List<Lint.Kind> suppressedLintKinds
ThisAspectInstanceback to summary
public static final int ThisAspectInstance
ThisEnclosingJoinPointStaticPartback to summary
public static final int ThisEnclosingJoinPointStaticPart
ThisJoinPointback to summary
public static final int ThisJoinPoint
ThisJoinPointStaticPartback to summary
public static final int ThisJoinPointStaticPart

Constructor Detail

Adviceback to summary
public Advice(AjAttribute.AdviceAttribute attribute, Pointcut pointcut, Member signature)

Method Detail

concretizeback to summary
public ShadowMunger concretize(ResolvedType fromType, World world, PerClause clause)

Implements abstract org.aspectj.weaver.ShadowMunger.concretize.

Parameters
fromType:ResolvedType

is guaranteed to be a non-abstract aspect

clause:PerClause

has been concretized at a higher level

Annotations
@Override
countOnesback to summary
public static int countOnes(int bits)
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
extraParametersToStringback to summary
protected String extraParametersToString()
getBaseParameterCountback to summary
public int getBaseParameterCount()
getBaseParameterNamesback to summary
public String[] getBaseParameterNames(World world)
getBindingParameterTypesback to summary
public UnresolvedType[] getBindingParameterTypes()
getConcreteAspectback to summary
public ResolvedType getConcreteAspect()

Implements abstract org.aspectj.weaver.ShadowMunger.getConcreteAspect.

getDeclaringAspectback to summary
public UnresolvedType getDeclaringAspect()
getExtraParameterCountback to summary
protected int getExtraParameterCount()
getExtraParameterFlagsback to summary
protected int getExtraParameterFlags()
getExtraParameterTypeback to summary
public UnresolvedType getExtraParameterType()

Return the type of the 'extra argument'. For either after returning or after throwing advice, the extra argument will be the returned value or the thrown exception respectively. With annotation style the user may declare the parameters in any order, whereas for code style they are in a well defined order. So there is some extra complexity in here for annotation style that looks up the correct parameter in the advice signature by name, based on the name specified in the annotation. If this fails then we 'fallback' to guessing at positions, where the extra argument is presumed to come at the end.

Returns:UnresolvedType

the type of the extraParameter

getKindback to summary
public AdviceKind getKind()
getOriginalSignatureback to summary
protected Member getOriginalSignature()
getPointcutback to summary
public Pointcut getPointcut()

Overrides org.aspectj.weaver.ShadowMunger.getPointcut.

Annotations
@Override
getSignatureback to summary
public Member getSignature()
hasDynamicTestsback to summary
public abstract boolean hasDynamicTests()
hasExtraParameterback to summary
public boolean hasExtraParameter()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
hasMatchedSomethingback to summary
public boolean hasMatchedSomething()
isAnnotationStyleback to summary
public boolean isAnnotationStyle()
isAroundAdviceback to summary
public boolean isAroundAdvice()

Overrides org.aspectj.weaver.ShadowMunger.isAroundAdvice.

makeCflowEntryback to summary
public static Advice makeCflowEntry(World world, Pointcut entry, boolean isBelow, Member stackField, int nFreeVars, List<ShadowMunger> innerCflowEntries, ResolvedType inAspect)
makePerCflowEntryback to summary
public static Advice makePerCflowEntry(World world, Pointcut entry, boolean isBelow, Member stackField, ResolvedType inAspect, List<ShadowMunger> innerCflowEntries)
makePerObjectEntryback to summary
public static Advice makePerObjectEntry(World world, Pointcut entry, boolean isThis, ResolvedType inAspect)
makePerTypeWithinEntryback to summary
public static Advice makePerTypeWithinEntry(World world, Pointcut p, ResolvedType inAspect)
makeSoftenerback to summary
public static Advice makeSoftener(World world, Pointcut entry, TypePattern exceptionType, ResolvedType inAspect, IHasSourceLocation loc)
matchback to summary
public boolean match(Shadow shadow, World world)

Overrides org.aspectj.weaver.ShadowMunger.match.

Doc from org.aspectj.weaver.ShadowMunger.match.

All overriding methods should call super

Annotations
@Override
maybeIssueUncheckedMatchWarningback to summary
private void maybeIssueUncheckedMatchWarning(ResolvedType afterReturningType, ResolvedType shadowReturnType, Shadow shadow, World world)

In after returning advice if we are binding the extra parameter to a parameterized type we may not be able to do a type-safe conversion.

Parameters
afterReturningType:ResolvedType

the type in the after returning declaration

shadowReturnType:ResolvedType

the type at the shadow

setBindingParameterTypesback to summary
public void setBindingParameterTypes(UnresolvedType[] types)
setHasMatchedSomethingback to summary
public void setHasMatchedSomething(boolean hasMatchedSomething)
setLexicalPositionback to summary
public void setLexicalPosition(int lexicalPosition)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override