Top Description Fields Constructors Methods
org.aspectj.weaver

public abstract Class ShadowMunger

extends Object
implements PartialComparable, IHasPosition
Class Inheritance
All Implemented Interfaces
org.aspectj.weaver.IHasPosition, org.aspectj.util.PartialOrder.PartialComparable
Known Direct Subclasses
org.aspectj.weaver.Advice, org.aspectj.weaver.Checker
Imports
java.io.File, .IOException, java.util.Collection, .HashSet, .Map, .Set, org.aspectj.bridge.IMessage, .ISourceLocation, .MessageUtil, .SourceLocation, org.aspectj.util.FuzzyBoolean, .PartialOrder, org.aspectj.weaver.patterns.PerClause, .Pointcut, .TypePattern

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 TypeField and Description
private File
private ISourceLocation
private boolean
private ResolvedType
protected int
public String
private boolean
public static final ShadowMunger[]
protected Pointcut
protected static final int
protected static final int
private int
protected ISourceContext
private ISourceLocation
protected int
private static int

Constructor Summary

AccessConstructor and Description
protected
public
ShadowMunger(Pointcut pointcut, int start, int end, ISourceContext sourceContext, int shadowMungerKind)

Method Summary

Modifier and TypeMethod and Description
public boolean
public abstract ShadowMunger
concretize(ResolvedType fromType, World world, PerClause clause)

public int
fallbackCompareTo(Object other)

Implements org.aspectj.util.PartialOrder.PartialComparable.fallbackCompareTo.

This method can provide a deterministic ordering for elements that are strictly not comparable.
private File
getBinaryFile()

Returns the File with pathname to the class file, for example either: C:\temp \ajcSandbox\workspace\ajcTest16957.tmp\simple.jar!pkg\BinaryAspect.class if the class file is in a jar file, or C:\temp\ajcSandbox\workspace\ajcTest16957.tmp!pkg\BinaryAspect.class if the class file is in a directory

public ISourceLocation
getBinarySourceLocation(ISourceLocation sl)

Returns the binarySourceLocation for the given sourcelocation.

public abstract ResolvedType
public ResolvedType
public int
getEnd()

Implements org.aspectj.weaver.IHasPosition.getEnd.

The ending index of this location in the character stream This points to the last character in this token.
public Pointcut
public ISourceLocation
public int
getStart()

Implements org.aspectj.weaver.IHasPosition.getStart.

The starting index of this location in the character stream.
public abstract Collection<ResolvedType>

Returns:

a Collection of ResolvedTypes for all checked exceptions that might be thrown by this munger
getThrownExceptions
()

public abstract boolean

Returns:

true if the implement was successful
implementOn
(Shadow
the shadow where this munger should be applied
shadow
)

Implement this munger at the specified shadow, returning a boolean to indicate success.

public boolean
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

public boolean
match(Shadow shadow, World world)

All overriding methods should call super

public abstract boolean

Returns:

true if munger has to check that its exceptions can be thrown based on the shadow
mustCheckExceptions
()

Does the munger have to check that its exception are accepted by the shadow ?

public abstract ShadowMunger
parameterizeWith(ResolvedType declaringType, Map<String, UnresolvedType> typeVariableMap)

public void
setDeclaringType(ResolvedType aType)

Invoked when the shadow munger of a resolved type are processed.

public void
public abstract void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

binaryFileback to summary
private File binaryFile
binarySourceLocationback to summary
private ISourceLocation binarySourceLocation
checkedIsBinaryback to summary
private boolean checkedIsBinary
declaringTypeback to summary
private ResolvedType declaringType
endback to summary
protected int end
handleback to summary
public String handle
isBinaryback to summary
private boolean isBinary
NONEback to summary
public static final ShadowMunger[] NONE
pointcutback to summary
protected Pointcut pointcut
ShadowMungerAdviceback to summary
protected static final int ShadowMungerAdvice
ShadowMungerDeowback to summary
protected static final int ShadowMungerDeow
shadowMungerKindback to summary
private int shadowMungerKind
sourceContextback to summary
protected ISourceContext sourceContext
sourceLocationback to summary
private ISourceLocation sourceLocation
startback to summary
protected int start
VERSION_1back to summary
private static int VERSION_1

Constructor Detail

ShadowMungerback to summary
protected ShadowMunger()
ShadowMungerback to summary
public ShadowMunger(Pointcut pointcut, int start, int end, ISourceContext sourceContext, int shadowMungerKind)

Method Detail

bindsProceedingJoinPointback to summary
public boolean bindsProceedingJoinPoint()
concretizeback to summary
public abstract ShadowMunger concretize(ResolvedType fromType, World world, PerClause clause)
fallbackCompareToback to summary
public int fallbackCompareTo(Object other)

Implements org.aspectj.util.PartialOrder.PartialComparable.fallbackCompareTo.

Doc from org.aspectj.util.PartialOrder.PartialComparable.fallbackCompareTo.

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.

getBinaryFileback to summary
private File getBinaryFile()

Returns the File with pathname to the class file, for example either:
C:\temp \ajcSandbox\workspace\ajcTest16957.tmp\simple.jar!pkg\BinaryAspect.class if the class file is in a jar file, or
C:\temp\ajcSandbox\workspace\ajcTest16957.tmp!pkg\BinaryAspect.class if the class file is in a directory

getBinarySourceLocationback to summary
public ISourceLocation getBinarySourceLocation(ISourceLocation sl)

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.

getConcreteAspectback to summary
public abstract ResolvedType getConcreteAspect()
getDeclaringTypeback to summary
public ResolvedType getDeclaringType()
getEndback to summary
public int getEnd()

Implements org.aspectj.weaver.IHasPosition.getEnd.

Doc from org.aspectj.weaver.IHasPosition.getEnd.

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.

getPointcutback to summary
public Pointcut getPointcut()
getSourceLocationback to summary
public ISourceLocation getSourceLocation()
getStartback to summary
public int getStart()

Implements org.aspectj.weaver.IHasPosition.getStart.

Doc from org.aspectj.weaver.IHasPosition.getStart.

The starting index of this location in the character stream.

getThrownExceptionsback to summary
public abstract Collection<ResolvedType> getThrownExceptions()
Returns:Collection<ResolvedType>

a Collection of ResolvedTypes for all checked exceptions that might be thrown by this munger

implementOnback to summary
public abstract boolean implementOn(Shadow shadow)

Implement this munger at the specified shadow, returning a boolean to indicate success.

Parameters
shadow:Shadow

the shadow where this munger should be applied

Returns:boolean

true if the implement was successful

isAroundAdviceback to summary
public boolean isAroundAdvice()
isBinaryback to summary
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

matchback to summary
public boolean match(Shadow shadow, World world)

All overriding methods should call super

mustCheckExceptionsback to summary
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:boolean

true if munger has to check that its exceptions can be thrown based on the shadow

parameterizeWithback to summary
public abstract ShadowMunger parameterizeWith(ResolvedType declaringType, Map<String, UnresolvedType> typeVariableMap)
setDeclaringTypeback to summary
public void setDeclaringType(ResolvedType aType)

Invoked when the shadow munger of a resolved type are processed.

setPointcutback to summary
public void setPointcut(Pointcut pointcut)
specializeOnback to summary
public abstract void specializeOn(Shadow shadow)
writeback to summary
public void write(CompressingDataOutputStream stream) throws IOException