Package org.aspectj.weaver
Class ShadowMunger
java.lang.Object
org.aspectj.weaver.ShadowMunger
- All Implemented Interfaces:
PartialOrder.PartialComparable
,IHasPosition
public abstract class ShadowMunger
extends Object
implements PartialOrder.PartialComparable, IHasPosition
For every shadow munger, nothing can be done with it until it is concretized. Then...
(Then we call fast match.)
For every shadow munger, for every shadow, first match is called, then (if match returned true) the shadow munger is specialized
for the shadow, which may modify state. Then implement is called.
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
static ShadowMunger[]
protected Pointcut
protected static int
protected static int
protected ISourceContext
protected int
-
Constructor Summary
ModifierConstructorDescriptionprotected
ShadowMunger(Pointcut pointcut, int start, int end, ISourceContext sourceContext, int shadowMungerKind)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract ShadowMunger
concretize(ResolvedType fromType, World world, PerClause clause)
int
fallbackCompareTo(Object other)
This method can provide a deterministic ordering for elements that are strictly not comparable.Returns the binarySourceLocation for the given sourcelocation.abstract ResolvedType
int
getEnd()
The ending index of this location in the character stream This points to the last character in this token.int
getStart()
The starting index of this location in the character stream.abstract Collection<ResolvedType>
abstract boolean
implementOn(Shadow shadow)
Implement this munger at the specified shadow, returning a boolean to indicate success.boolean
boolean
isBinary()
Returns whether or not this shadow munger came from a binary aspect - keep a record of whether or not we've checked if we're binary otherwise we keep calculating the same thing many timesboolean
All overriding methods should call superabstract boolean
Does the munger have to check that its exception are accepted by the shadow ?abstract ShadowMunger
parameterizeWith(ResolvedType declaringType, Map<String,UnresolvedType> typeVariableMap)
void
setDeclaringType(ResolvedType aType)
Invoked when the shadow munger of a resolved type are processed.void
setPointcut(Pointcut pointcut)
abstract void
specializeOn(Shadow shadow)
void
write(CompressingDataOutputStream stream)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.aspectj.util.PartialOrder.PartialComparable
compareTo
-
Field Details
-
NONE
-
ShadowMungerAdvice
protected static final int ShadowMungerAdvice- See Also:
- Constant Field Values
-
ShadowMungerDeow
protected static final int ShadowMungerDeow- See Also:
- Constant Field Values
-
handle
-
start
protected int start -
end
protected int end -
sourceContext
-
pointcut
-
-
Constructor Details
-
ShadowMunger
protected ShadowMunger() -
ShadowMunger
public ShadowMunger(Pointcut pointcut, int start, int end, ISourceContext sourceContext, int shadowMungerKind)
-
-
Method Details
-
match
All overriding methods should call super -
fallbackCompareTo
Description copied from interface:PartialOrder.PartialComparable
This method can provide a deterministic ordering for elements that are strictly not comparable. If you have no need for this, this method can just return 0 whenever called.- Specified by:
fallbackCompareTo
in interfacePartialOrder.PartialComparable
-
getEnd
public int getEnd()Description copied from interface:IHasPosition
The ending index of this location in the character stream This points to the last character in this token. If a location truly had no contents, then start == end + 1. We don't recommend this.- Specified by:
getEnd
in interfaceIHasPosition
-
getStart
public int getStart()Description copied from interface:IHasPosition
The starting index of this location in the character stream.- Specified by:
getStart
in interfaceIHasPosition
-
getSourceLocation
-
getPointcut
-
setPointcut
-
setDeclaringType
Invoked when the shadow munger of a resolved type are processed.- Parameters:
aType
-
-
getDeclaringType
-
getConcreteAspect
-
getBinarySourceLocation
Returns the binarySourceLocation for the given sourcelocation. This isn't cached because it's used when faulting in the binary nodes and is called with ISourceLocations for all advice, pointcuts and deows contained within the resolvedDeclaringAspect. -
isBinary
public boolean isBinary()Returns whether or not this shadow munger came from a binary aspect - keep a record of whether or not we've checked if we're binary otherwise we keep calculating the same thing many times -
concretize
-
specializeOn
-
implementOn
Implement this munger at the specified shadow, returning a boolean to indicate success.- Parameters:
shadow
- the shadow where this munger should be applied- Returns:
- true if the implement was successful
-
parameterizeWith
public abstract ShadowMunger parameterizeWith(ResolvedType declaringType, Map<String,UnresolvedType> typeVariableMap) -
getThrownExceptions
- Returns:
- a Collection of ResolvedTypes for all checked exceptions that might be thrown by this munger
-
mustCheckExceptions
public abstract boolean mustCheckExceptions()Does the munger have to check that its exception are accepted by the shadow ? It is not the case for annotation style around advice, for example: that can throw Throwable, even if the advised method does not throw any exceptions.- Returns:
- true if munger has to check that its exceptions can be thrown based on the shadow
-
write
- Throws:
IOException
-
bindsProceedingJoinPoint
public boolean bindsProceedingJoinPoint() -
isAroundAdvice
public boolean isAroundAdvice()
-