org.aspectj.weaver
Class Advice
java.lang.Object
org.aspectj.weaver.ShadowMunger
org.aspectj.weaver.Advice
- All Implemented Interfaces:
- PartialOrder.PartialComparable, IHasPosition
public abstract class Advice
- extends ShadowMunger
Method Summary |
ShadowMunger |
concretize(ResolvedType fromType,
World world,
PerClause clause)
|
static int |
countOnes(int bits)
|
boolean |
equals(java.lang.Object other)
|
protected java.lang.String |
extraParametersToString()
|
int |
getBaseParameterCount()
|
java.lang.String[] |
getBaseParameterNames(World world)
|
UnresolvedType[] |
getBindingParameterTypes()
|
ResolvedType |
getConcreteAspect()
|
UnresolvedType |
getDeclaringAspect()
|
protected int |
getExtraParameterCount()
|
protected int |
getExtraParameterFlags()
|
UnresolvedType |
getExtraParameterType()
Return the type of the 'extra argument'. |
AdviceKind |
getKind()
|
protected Member |
getOriginalSignature()
|
Pointcut |
getPointcut()
|
Member |
getSignature()
|
abstract boolean |
hasDynamicTests()
|
boolean |
hasExtraParameter()
|
int |
hashCode()
|
boolean |
hasMatchedSomething()
|
boolean |
isAnnotationStyle()
|
static Advice |
makeCflowEntry(World world,
Pointcut entry,
boolean isBelow,
Member stackField,
int nFreeVars,
java.util.List<ShadowMunger> innerCflowEntries,
ResolvedType inAspect)
|
static Advice |
makePerCflowEntry(World world,
Pointcut entry,
boolean isBelow,
Member stackField,
ResolvedType inAspect,
java.util.List<ShadowMunger> innerCflowEntries)
|
static Advice |
makePerObjectEntry(World world,
Pointcut entry,
boolean isThis,
ResolvedType inAspect)
|
static Advice |
makePerTypeWithinEntry(World world,
Pointcut p,
ResolvedType inAspect)
|
static Advice |
makeSoftener(World world,
Pointcut entry,
TypePattern exceptionType,
ResolvedType inAspect,
IHasSourceLocation loc)
|
boolean |
match(Shadow shadow,
World world)
All overriding methods should call super |
void |
setBindingParameterTypes(UnresolvedType[] types)
|
void |
setHasMatchedSomething(boolean hasMatchedSomething)
|
void |
setLexicalPosition(int lexicalPosition)
|
java.lang.String |
toString()
|
Methods inherited from class org.aspectj.weaver.ShadowMunger |
fallbackCompareTo, getBinarySourceLocation, getDeclaringType, getEnd, getSourceLocation, getStart, getThrownExceptions, implementOn, isBinary, mustCheckExceptions, parameterizeWith, setDeclaringType, setPointcut, specializeOn, write |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
attribute
protected AjAttribute.AdviceAttribute attribute
kind
protected transient AdviceKind kind
signature
protected Member signature
concreteAspect
protected ResolvedType concreteAspect
innerCflowEntries
protected java.util.List<ShadowMunger> innerCflowEntries
nFreeVars
protected int nFreeVars
exceptionType
protected TypePattern exceptionType
bindingParameterTypes
protected UnresolvedType[] bindingParameterTypes
hasMatchedAtLeastOnce
protected boolean hasMatchedAtLeastOnce
suppressedLintKinds
protected java.util.List<Lint.Kind> suppressedLintKinds
lastReportedMonitorExitJoinpointLocation
public ISourceLocation lastReportedMonitorExitJoinpointLocation
ExtraArgument
public static final int ExtraArgument
- See Also:
- Constant Field Values
ThisJoinPoint
public static final int ThisJoinPoint
- See Also:
- Constant Field Values
ThisJoinPointStaticPart
public static final int ThisJoinPointStaticPart
- See Also:
- Constant Field Values
ThisEnclosingJoinPointStaticPart
public static final int ThisEnclosingJoinPointStaticPart
- See Also:
- Constant Field Values
ParameterMask
public static final int ParameterMask
- See Also:
- Constant Field Values
ConstantReference
public static final int ConstantReference
- See Also:
- Constant Field Values
ConstantValue
public static final int ConstantValue
- See Also:
- Constant Field Values
ThisAspectInstance
public static final int ThisAspectInstance
- See Also:
- Constant Field Values
Advice
public Advice(AjAttribute.AdviceAttribute attribute,
Pointcut pointcut,
Member signature)
makeCflowEntry
public static Advice makeCflowEntry(World world,
Pointcut entry,
boolean isBelow,
Member stackField,
int nFreeVars,
java.util.List<ShadowMunger> innerCflowEntries,
ResolvedType inAspect)
makePerCflowEntry
public static Advice makePerCflowEntry(World world,
Pointcut entry,
boolean isBelow,
Member stackField,
ResolvedType inAspect,
java.util.List<ShadowMunger> innerCflowEntries)
makePerObjectEntry
public static Advice makePerObjectEntry(World world,
Pointcut entry,
boolean isThis,
ResolvedType inAspect)
makePerTypeWithinEntry
public static Advice makePerTypeWithinEntry(World world,
Pointcut p,
ResolvedType inAspect)
makeSoftener
public static Advice makeSoftener(World world,
Pointcut entry,
TypePattern exceptionType,
ResolvedType inAspect,
IHasSourceLocation loc)
match
public boolean match(Shadow shadow,
World world)
- Description copied from class:
ShadowMunger
- All overriding methods should call super
- Overrides:
match
in class ShadowMunger
getKind
public AdviceKind getKind()
getSignature
public Member getSignature()
hasExtraParameter
public boolean hasExtraParameter()
getExtraParameterFlags
protected int getExtraParameterFlags()
getExtraParameterCount
protected int getExtraParameterCount()
getBindingParameterTypes
public UnresolvedType[] getBindingParameterTypes()
setBindingParameterTypes
public void setBindingParameterTypes(UnresolvedType[] types)
countOnes
public static int countOnes(int bits)
getBaseParameterCount
public int getBaseParameterCount()
getBaseParameterNames
public java.lang.String[] getBaseParameterNames(World world)
getExtraParameterType
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:
- the type of the extraParameter
getDeclaringAspect
public UnresolvedType getDeclaringAspect()
getOriginalSignature
protected Member getOriginalSignature()
extraParametersToString
protected java.lang.String extraParametersToString()
getPointcut
public Pointcut getPointcut()
- Overrides:
getPointcut
in class ShadowMunger
concretize
public ShadowMunger concretize(ResolvedType fromType,
World world,
PerClause clause)
- Specified by:
concretize
in class ShadowMunger
- Parameters:
fromType
- is guaranteed to be a non-abstract aspectclause
- has been concretized at a higher level
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
setLexicalPosition
public void setLexicalPosition(int lexicalPosition)
isAnnotationStyle
public boolean isAnnotationStyle()
getConcreteAspect
public ResolvedType getConcreteAspect()
- Specified by:
getConcreteAspect
in class ShadowMunger
hasMatchedSomething
public boolean hasMatchedSomething()
setHasMatchedSomething
public void setHasMatchedSomething(boolean hasMatchedSomething)
hasDynamicTests
public abstract boolean hasDynamicTests()