org.aspectj.weaver
Class ShadowMunger

java.lang.Object
  extended by org.aspectj.weaver.ShadowMunger
All Implemented Interfaces:
PartialOrder.PartialComparable, IHasPosition
Direct Known Subclasses:
Advice, Checker

public abstract class ShadowMunger
extends java.lang.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
protected  int end
           
 java.lang.String handle
           
static ShadowMunger[] NONE
           
protected  Pointcut pointcut
           
protected static int ShadowMungerAdvice
           
protected static int ShadowMungerDeow
           
protected  ISourceContext sourceContext
           
protected  int start
           
 
Constructor Summary
protected ShadowMunger()
           
  ShadowMunger(Pointcut pointcut, int start, int end, ISourceContext sourceContext, int shadowMungerKind)
           
 
Method Summary
abstract  ShadowMunger concretize(ResolvedType fromType, World world, PerClause clause)
           
 int fallbackCompareTo(java.lang.Object other)
          This method can provide a deterministic ordering for elements that are strictly not comparable.
 ISourceLocation getBinarySourceLocation(ISourceLocation sl)
          Returns the binarySourceLocation for the given sourcelocation.
abstract  ResolvedType getConcreteAspect()
           
 ResolvedType getDeclaringType()
           
 int getEnd()
          The ending index of this location in the character stream This points to the last character in this token.
 Pointcut getPointcut()
           
 ISourceLocation getSourceLocation()
           
 int getStart()
          The starting index of this location in the character stream.
abstract  java.util.Collection<ResolvedType> getThrownExceptions()
           
abstract  boolean implementOn(Shadow shadow)
          Implement this munger at the specified shadow, returning a boolean to indicate success.
 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
 boolean match(Shadow shadow, World world)
          All overriding methods should call super
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.
abstract  ShadowMunger parameterizeWith(ResolvedType declaringType, java.util.Map<java.lang.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 Detail

NONE

public static final ShadowMunger[] NONE

ShadowMungerAdvice

protected static final int ShadowMungerAdvice
See Also:
Constant Field Values

ShadowMungerDeow

protected static final int ShadowMungerDeow
See Also:
Constant Field Values

handle

public java.lang.String handle

start

protected int start

end

protected int end

sourceContext

protected ISourceContext sourceContext

pointcut

protected Pointcut pointcut
Constructor Detail

ShadowMunger

protected ShadowMunger()

ShadowMunger

public ShadowMunger(Pointcut pointcut,
                    int start,
                    int end,
                    ISourceContext sourceContext,
                    int shadowMungerKind)
Method Detail

match

public boolean match(Shadow shadow,
                     World world)
All overriding methods should call super


fallbackCompareTo

public int fallbackCompareTo(java.lang.Object other)
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 interface PartialOrder.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 interface IHasPosition

getStart

public int getStart()
Description copied from interface: IHasPosition
The starting index of this location in the character stream.

Specified by:
getStart in interface IHasPosition

getSourceLocation

public ISourceLocation getSourceLocation()

getPointcut

public Pointcut getPointcut()

setPointcut

public void setPointcut(Pointcut pointcut)

setDeclaringType

public void setDeclaringType(ResolvedType aType)
Invoked when the shadow munger of a resolved type are processed.

Parameters:
aType -

getDeclaringType

public ResolvedType getDeclaringType()

getConcreteAspect

public abstract ResolvedType getConcreteAspect()

getBinarySourceLocation

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.


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

public abstract ShadowMunger concretize(ResolvedType fromType,
                                        World world,
                                        PerClause clause)

specializeOn

public abstract void specializeOn(Shadow shadow)

implementOn

public abstract boolean implementOn(Shadow shadow)
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,
                                              java.util.Map<java.lang.String,UnresolvedType> typeVariableMap)

getThrownExceptions

public abstract java.util.Collection<ResolvedType> 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

public void write(CompressingDataOutputStream stream)
           throws java.io.IOException
Throws:
java.io.IOException