org.aspectj.weaver
Class Shadow

java.lang.Object
  extended by org.aspectj.weaver.Shadow
Direct Known Subclasses:
BcelShadow, ReflectionShadow, StandardShadow

public abstract class Shadow
extends java.lang.Object


Nested Class Summary
static class Shadow.Kind
          A type-safe enum representing the kind of shadows
 
Field Summary
static java.lang.String ADVICE_EXECUTION
           
static Shadow.Kind AdviceExecution
           
static int AdviceExecutionBit
           
static int ALL_SHADOW_KINDS_BITS
           
static java.lang.String CONSTRUCTOR_CALL
           
static java.lang.String CONSTRUCTOR_EXECUTION
           
static Shadow.Kind ConstructorCall
           
static int ConstructorCallBit
           
static Shadow.Kind ConstructorExecution
           
static int ConstructorExecutionBit
           
protected  Shadow enclosingShadow
           
static java.lang.String EXCEPTION_HANDLER
           
static Shadow.Kind ExceptionHandler
           
static int ExceptionHandlerBit
           
static java.lang.String FIELD_GET
           
static java.lang.String FIELD_SET
           
static Shadow.Kind FieldGet
           
static int FieldGetBit
           
static Shadow.Kind FieldSet
           
static int FieldSetBit
           
static Shadow.Kind Initialization
           
static java.lang.String INITIALIZATION
           
static int InitializationBit
           
static int MAX_SHADOW_KIND
           
static java.lang.String METHOD_CALL
           
static java.lang.String METHOD_EXECUTION
           
static Shadow.Kind MethodCall
          These names are the ones that will be returned by thisJoinPoint.getKind() Those need to be documented somewhere
static int MethodCallBit
           
static Shadow.Kind MethodExecution
           
static int MethodExecutionBit
           
protected  java.util.List<ShadowMunger> mungers
           
static int NO_SHADOW_KINDS_BITS
           
static Shadow.Kind PreInitialization
           
static java.lang.String PREINITIALIZATION
           
static int PreInitializationBit
           
static Shadow.Kind[] SHADOW_KINDS
           
 int shadowId
           
static Shadow.Kind StaticInitialization
           
static java.lang.String STATICINITIALIZATION
           
static int StaticInitializationBit
           
static java.lang.String SYNCHRONIZATION_LOCK
           
static java.lang.String SYNCHRONIZATION_UNLOCK
           
static Shadow.Kind SynchronizationLock
           
static int SynchronizationLockBit
           
static Shadow.Kind SynchronizationUnlock
           
static int SynchronizationUnlockBit
           
 
Constructor Summary
protected Shadow(Shadow.Kind kind, Member signature, Shadow enclosingShadow)
           
 
Method Summary
 void addMunger(ShadowMunger munger)
           
protected  boolean checkCanThrow(ShadowMunger munger, ResolvedType resolvedTypeX)
           
protected  boolean checkMunger(ShadowMunger munger)
          Only does the check if the munger requires it (@AJ aspects don't)
abstract  Var getArgAnnotationVar(int i, UnresolvedType forAnnotationType)
           
 int getArgCount()
           
 UnresolvedType getArgType(int arg)
           
 UnresolvedType[] getArgTypes()
           
 ResolvedType[] getArgumentTypesForArrayConstructionShadow()
           
abstract  Var getArgVar(int i)
           
abstract  Member getEnclosingCodeSignature()
           
abstract  UnresolvedType getEnclosingType()
           
 UnresolvedType[] getGenericArgTypes()
           
abstract  World getIWorld()
           
 Shadow.Kind getKind()
          returns the kind of shadow this is, representing what happens under this shadow
abstract  Var getKindedAnnotationVar(UnresolvedType forAnnotationType)
           
 Member getMatchingSignature()
          returns the signature of the thing under this shadow, with any synthetic arguments removed
 java.util.List<ShadowMunger> getMungers()
           
 ResolvedMember getResolvedSignature()
          returns the resolved signature of the thing under this shadow
 UnresolvedType getReturnType()
           
 Member getSignature()
          returns the signature of the thing under this shadow
abstract  ISourceLocation getSourceLocation()
           
abstract  Var getTargetAnnotationVar(UnresolvedType forAnnotationType)
           
 UnresolvedType getTargetType()
          the type of the target object here
abstract  Var getTargetVar()
          a var referencing the target
abstract  Var getThisAnnotationVar(UnresolvedType forAnnotationType)
           
abstract  Var getThisAspectInstanceVar(ResolvedType aspectType)
           
abstract  Var getThisEnclosingJoinPointStaticPartVar()
           
abstract  Var getThisJoinPointStaticPartVar()
           
abstract  Var getThisJoinPointVar()
           
 UnresolvedType getThisType()
          the type of the this object here
abstract  Var getThisVar()
          a var referencing this
abstract  Var getWithinAnnotationVar(UnresolvedType forAnnotationType)
           
abstract  Var getWithinCodeAnnotationVar(UnresolvedType forAnnotationType)
           
 boolean hasTarget()
          could target(*) pcd ever match
 boolean hasThis()
          could this(*) pcd ever match
static int howMany(int i)
          Return count of how many bits set in the supplied parameter.
 void implement()
           
 boolean isShadowForArrayConstructionJoinpoint()
           
 boolean isShadowForMonitor()
           
protected  void prepareForMungers()
          Prepare the shadow for implementation.
 void setMatchingSignature(Member member)
           
 java.lang.String toResolvedString(World world)
           
static java.util.Set<Shadow.Kind> toSet(int i)
          Convert a bit array for the shadow kinds into a set of them...
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enclosingShadow

protected final Shadow enclosingShadow

mungers

protected java.util.List<ShadowMunger> mungers

shadowId

public int shadowId

METHOD_EXECUTION

public static java.lang.String METHOD_EXECUTION

METHOD_CALL

public static java.lang.String METHOD_CALL

CONSTRUCTOR_EXECUTION

public static java.lang.String CONSTRUCTOR_EXECUTION

CONSTRUCTOR_CALL

public static java.lang.String CONSTRUCTOR_CALL

FIELD_GET

public static java.lang.String FIELD_GET

FIELD_SET

public static java.lang.String FIELD_SET

STATICINITIALIZATION

public static java.lang.String STATICINITIALIZATION

PREINITIALIZATION

public static java.lang.String PREINITIALIZATION

INITIALIZATION

public static java.lang.String INITIALIZATION

EXCEPTION_HANDLER

public static java.lang.String EXCEPTION_HANDLER

SYNCHRONIZATION_LOCK

public static java.lang.String SYNCHRONIZATION_LOCK

SYNCHRONIZATION_UNLOCK

public static java.lang.String SYNCHRONIZATION_UNLOCK

ADVICE_EXECUTION

public static java.lang.String ADVICE_EXECUTION

MethodCall

public static final Shadow.Kind MethodCall
These names are the ones that will be returned by thisJoinPoint.getKind() Those need to be documented somewhere


ConstructorCall

public static final Shadow.Kind ConstructorCall

MethodExecution

public static final Shadow.Kind MethodExecution

ConstructorExecution

public static final Shadow.Kind ConstructorExecution

FieldGet

public static final Shadow.Kind FieldGet

FieldSet

public static final Shadow.Kind FieldSet

StaticInitialization

public static final Shadow.Kind StaticInitialization

PreInitialization

public static final Shadow.Kind PreInitialization

AdviceExecution

public static final Shadow.Kind AdviceExecution

Initialization

public static final Shadow.Kind Initialization

ExceptionHandler

public static final Shadow.Kind ExceptionHandler

SynchronizationLock

public static final Shadow.Kind SynchronizationLock

SynchronizationUnlock

public static final Shadow.Kind SynchronizationUnlock

MethodCallBit

public static final int MethodCallBit
See Also:
Constant Field Values

ConstructorCallBit

public static final int ConstructorCallBit
See Also:
Constant Field Values

MethodExecutionBit

public static final int MethodExecutionBit
See Also:
Constant Field Values

ConstructorExecutionBit

public static final int ConstructorExecutionBit
See Also:
Constant Field Values

FieldGetBit

public static final int FieldGetBit
See Also:
Constant Field Values

FieldSetBit

public static final int FieldSetBit
See Also:
Constant Field Values

StaticInitializationBit

public static final int StaticInitializationBit
See Also:
Constant Field Values

PreInitializationBit

public static final int PreInitializationBit
See Also:
Constant Field Values

AdviceExecutionBit

public static final int AdviceExecutionBit
See Also:
Constant Field Values

InitializationBit

public static final int InitializationBit
See Also:
Constant Field Values

ExceptionHandlerBit

public static final int ExceptionHandlerBit
See Also:
Constant Field Values

SynchronizationLockBit

public static final int SynchronizationLockBit
See Also:
Constant Field Values

SynchronizationUnlockBit

public static final int SynchronizationUnlockBit
See Also:
Constant Field Values

MAX_SHADOW_KIND

public static final int MAX_SHADOW_KIND
See Also:
Constant Field Values

SHADOW_KINDS

public static final Shadow.Kind[] SHADOW_KINDS

ALL_SHADOW_KINDS_BITS

public static final int ALL_SHADOW_KINDS_BITS

NO_SHADOW_KINDS_BITS

public static final int NO_SHADOW_KINDS_BITS
Constructor Detail

Shadow

protected Shadow(Shadow.Kind kind,
                 Member signature,
                 Shadow enclosingShadow)
Method Detail

getIWorld

public abstract World getIWorld()

getMungers

public java.util.List<ShadowMunger> getMungers()

hasThis

public final boolean hasThis()
could this(*) pcd ever match


getThisType

public final UnresolvedType getThisType()
the type of the this object here

Throws:
java.lang.IllegalStateException - if there is no this here

getThisVar

public abstract Var getThisVar()
a var referencing this

Throws:
java.lang.IllegalStateException - if there is no target here

hasTarget

public final boolean hasTarget()
could target(*) pcd ever match


getTargetType

public final UnresolvedType getTargetType()
the type of the target object here

Throws:
java.lang.IllegalStateException - if there is no target here

getTargetVar

public abstract Var getTargetVar()
a var referencing the target

Throws:
java.lang.IllegalStateException - if there is no target here

getArgTypes

public UnresolvedType[] getArgTypes()

isShadowForArrayConstructionJoinpoint

public boolean isShadowForArrayConstructionJoinpoint()

isShadowForMonitor

public boolean isShadowForMonitor()

getArgumentTypesForArrayConstructionShadow

public ResolvedType[] getArgumentTypesForArrayConstructionShadow()

getGenericArgTypes

public UnresolvedType[] getGenericArgTypes()

getArgType

public UnresolvedType getArgType(int arg)

getArgCount

public int getArgCount()

getEnclosingType

public abstract UnresolvedType getEnclosingType()

getArgVar

public abstract Var getArgVar(int i)

getThisJoinPointVar

public abstract Var getThisJoinPointVar()

getThisJoinPointStaticPartVar

public abstract Var getThisJoinPointStaticPartVar()

getThisEnclosingJoinPointStaticPartVar

public abstract Var getThisEnclosingJoinPointStaticPartVar()

getThisAspectInstanceVar

public abstract Var getThisAspectInstanceVar(ResolvedType aspectType)

getKindedAnnotationVar

public abstract Var getKindedAnnotationVar(UnresolvedType forAnnotationType)

getWithinAnnotationVar

public abstract Var getWithinAnnotationVar(UnresolvedType forAnnotationType)

getWithinCodeAnnotationVar

public abstract Var getWithinCodeAnnotationVar(UnresolvedType forAnnotationType)

getThisAnnotationVar

public abstract Var getThisAnnotationVar(UnresolvedType forAnnotationType)

getTargetAnnotationVar

public abstract Var getTargetAnnotationVar(UnresolvedType forAnnotationType)

getArgAnnotationVar

public abstract Var getArgAnnotationVar(int i,
                                        UnresolvedType forAnnotationType)

getEnclosingCodeSignature

public abstract Member getEnclosingCodeSignature()

getKind

public Shadow.Kind getKind()
returns the kind of shadow this is, representing what happens under this shadow


getSignature

public Member getSignature()
returns the signature of the thing under this shadow


getMatchingSignature

public Member getMatchingSignature()
returns the signature of the thing under this shadow, with any synthetic arguments removed


setMatchingSignature

public void setMatchingSignature(Member member)

getResolvedSignature

public ResolvedMember getResolvedSignature()
returns the resolved signature of the thing under this shadow


getReturnType

public UnresolvedType getReturnType()

howMany

public static int howMany(int i)
Return count of how many bits set in the supplied parameter.


checkMunger

protected boolean checkMunger(ShadowMunger munger)
Only does the check if the munger requires it (@AJ aspects don't)

Parameters:
munger -
Returns:

checkCanThrow

protected boolean checkCanThrow(ShadowMunger munger,
                                ResolvedType resolvedTypeX)

addMunger

public void addMunger(ShadowMunger munger)

implement

public final void implement()

prepareForMungers

protected void prepareForMungers()
Prepare the shadow for implementation. After this is done, the shadow should be in such a position that each munger simply needs to be implemented.


getSourceLocation

public abstract ISourceLocation getSourceLocation()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toResolvedString

public java.lang.String toResolvedString(World world)

toSet

public static java.util.Set<Shadow.Kind> toSet(int i)
Convert a bit array for the shadow kinds into a set of them... should only be used for testing - mainline code should do bit manipulation!