org.aspectj.compiler.crosscuts.ast
Class AdviceDec

java.lang.Object
  extended byorg.aspectj.compiler.base.CompilerObject
      extended byorg.aspectj.compiler.base.ast.ASTObject
          extended byorg.aspectj.compiler.base.ast.Stmt
              extended byorg.aspectj.compiler.base.ast.Dec
                  extended byorg.aspectj.compiler.base.ast.CodeDec
                      extended byorg.aspectj.compiler.crosscuts.ast.AdviceDec
All Implemented Interfaces:
AspectMember, org.aspectj.compiler.crosscuts.joinpoints.JpPlannerMaker, PossibleSoftThrowable
Direct Known Subclasses:
AfterAdviceDec, AfterReturningAdviceDec, AfterThrowingAdviceDec, AroundAdviceDec, BeforeAdviceDec

public abstract class AdviceDec
extends CodeDec
implements org.aspectj.compiler.crosscuts.joinpoints.JpPlannerMaker, AspectMember


Field Summary
protected  Pcd pcd
           
protected  FormalDec thisDynamicJoinPointFormal
           
protected  FormalDec thisStaticEnclosingJoinPointFormal
           
protected  FormalDec thisStaticJoinPointFormal
           
 
Fields inherited from class org.aspectj.compiler.base.ast.CodeDec
_throws, body, formals, modifiers
 
Fields inherited from class org.aspectj.compiler.base.ast.Dec
forcePublic, owner, semanticObject
 
Fields inherited from class org.aspectj.compiler.base.ast.ASTObject
dummySource, parent, sourceLocation
 
Constructor Summary
protected AdviceDec(SourceLocation source)
           
  AdviceDec(SourceLocation location, Modifiers _modifiers, Formals _formals, TypeDs __throws, Pcd _pcd, CodeBody _body)
           
 
Method Summary
 void addJoinPointFormals(Formals formals)
           
 void checkSpec()
           
 boolean dominates(AdviceDec otherAdvice)
           
protected  void finishMethodDec(MethodDec methodDec)
           
protected abstract  java.lang.String getAdviceKind()
           
 AspectDec getAspectDec()
           
 ASTObject getChildAt(int childIndex)
           
 int getChildCount()
           
 java.lang.String getChildNameAt(int childIndex)
           
 java.lang.String getDefaultDisplayName()
           
 Type getExtraArgType()
           
 FormalDec getExtraFormal()
          returns the after returning or after throwing formal.
 java.lang.String getId()
           
 java.lang.String getKind()
           
 MethodDec getMethodDec()
           
 Pcd getPcd()
           
 TypeD getResultTypeD()
           
 Type getReturnType()
           
protected  boolean isAfterAdvice()
           
protected  org.aspectj.compiler.base.cst.BlockScope makeBodyScope(org.aspectj.compiler.base.cst.Scope parent)
           
 Expr makeCall(Expr parent, Exprs baseExprs)
           
 MethodDec makeConcreteMethod()
           
protected  Formals makeFormals()
           
protected  FormalDec makeJoinPointFormal(java.lang.String name)
           
protected  FormalDec makeJoinPointStaticPartFormal(java.lang.String name)
           
protected  CodeBody makeMethodBody()
          returns the method body used for the java method corresponding to this advice this method body is my actual body in the AST, never a copy
 org.aspectj.compiler.crosscuts.joinpoints.JpPlanner makePlanner(PlanData planData)
           
 boolean needsCallSiteContext()
           
 boolean needsDynamicJoinPointFormal()
           
 boolean needsStaticEnclosingJoinPointFormal()
           
 boolean needsStaticJoinPointFormal()
           
 ASTObject postFixAST(org.aspectj.compiler.base.ASTFixerPass fixer)
          Replace the advice with its corresponding MethodDec in the AspectDec
 void preScope(ScopeWalker walker)
           
protected  boolean reverseSortOrder(AdviceDec a1, AdviceDec a2)
           
 void setChildAt(int childIndex, ASTObject child)
           
 void setPcd(Pcd _pcd)
           
protected  void setupFlowWalker(org.aspectj.compiler.base.FlowCheckerPass w)
          set up the flow walker, by adding implicit variables like thisJoinPoint, etc
 java.lang.String toShortString()
           
 void unparse(org.aspectj.compiler.base.CodeWriter writer)
           
 void wrapJoinPoint(org.aspectj.compiler.crosscuts.joinpoints.JoinPoint joinPoint, org.aspectj.compiler.crosscuts.joinpoints.AdvicePlan plan)
           
protected  Stmts wrapStmts(Stmts stmts, org.aspectj.compiler.crosscuts.joinpoints.AdvicePlan plan)
           
 
Methods inherited from class org.aspectj.compiler.base.ast.CodeDec
addThrows, addThrowsType, appearsStaticToCaller, blockToBody, canThrow, cgCodeMember, cgMember, cleanup, computeMinimalThrows, conflictsWith, getBody, getCallExprs, getDescriptor, getEffectivelyFinalFormals, getFormals, getFrameSize, getModifiers, getPossibleCheckedExceptions, getResultType, getStackDelta, getThrows, hasThis, isAlmostApplicable, isApplicable, isMoreSpecificThan, isSoftThrowable, postCleanup, postScope, setBody, setBody, setFormals, setFrameSize, setModifiers, setSoftThrowable, setThrows, walkAnalysis, walkCleanup, walkFlow, walkFrameLoc, walkInnerInfo
 
Methods inherited from class org.aspectj.compiler.base.ast.Dec
addIntroducedFromType, checkOverride, dominates, forcePublic, getBytecodeId, getCorrespondingSemanticObject, getDeclaringType, getLexicalType, getName, getOutermostLexicalType, getSignatureString, inStaticContext, isAbstract, isAccessible, isAccessible, isDeprecated, isFinal, isInherited, isIntroduced, isLanguageVisible, isMoreAccessibleThan, isPrivate, isProtected, isPublic, isStatic, isSynthetic, lookupDeclaringType, lookupLexicalType, makeBlockScope, makeCorrespondingSemanticObject, postCopy, preCopy, preMove, requireStmt, samePackage, setAllEnclosingTypes, setBytecodeId, setDeclaringType, setDeprecated, setExplicitlyNonSynthetic, setFromLexicalScope, setId, setLanguageVisible, setLexicalType, walkForwardReference, writeModifiers, writeNames
 
Methods inherited from class org.aspectj.compiler.base.ast.Stmt
cgStmt, cgTop, completesNormally, isBreakable, isContinuable, isEmpty, mustBeLive, registerLocation, requireBlockStmt, setCompletesNormally
 
Methods inherited from class org.aspectj.compiler.base.ast.ASTObject
addComment, buildAccessMethod, checkNoSharing, clearComment, clearParent, contains, containsTypes, copy, copyWalk, display, fixAccessPost, fixAST, fromSource, getAST, getBeginColumn, getBeginLine, getBytecodeType, getBytecodeTypeDec, getComment, getCompilationUnit, getEnclosingCodeDec, getEnclosingDec, getEndColumn, getEndLine, getEndPosition, getFormalComment, getOutermostBytecodeType, getParent, getSourceDirectoryName, getSourceFile, getSourceFileName, getSourceLocation, getStartPosition, hasLegalProtectedAccess, hasSource, hasSourceLocation, implementMixin, indexOf, isLeaf, makeChild, makeChild, postAssignmentCheck, postImplementMixin, postInnerAccess, postInnerInfo, postLift, postMove, postThreading, preAssignmentCheck, preIntroduction, preLift, preThreading, remove, remove, removeChildAt, replaceWith, setFormalComment, setParent, setParents, setSource, setSourceLocation, setSyntheticSource, showError, showMessage, showTypeError, showWarning, toString, unparse, walk, walkAssignmentCheck, walkMemberMunger, walkScope
 
Methods inherited from class org.aspectj.compiler.base.CompilerObject
getCompiler, getOptions, getTypeManager, getWorld
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.aspectj.compiler.crosscuts.ast.AspectMember
cgTop, cleanup, setParent, unparse
 

Field Detail

thisDynamicJoinPointFormal

protected FormalDec thisDynamicJoinPointFormal

thisStaticJoinPointFormal

protected FormalDec thisStaticJoinPointFormal

thisStaticEnclosingJoinPointFormal

protected FormalDec thisStaticEnclosingJoinPointFormal

pcd

protected Pcd pcd
Constructor Detail

AdviceDec

public AdviceDec(SourceLocation location,
                 Modifiers _modifiers,
                 Formals _formals,
                 TypeDs __throws,
                 Pcd _pcd,
                 CodeBody _body)

AdviceDec

protected AdviceDec(SourceLocation source)
Method Detail

getKind

public java.lang.String getKind()
Specified by:
getKind in class Dec

getAspectDec

public AspectDec getAspectDec()

getExtraFormal

public FormalDec getExtraFormal()
returns the after returning or after throwing formal. Overridden in AfterReturningAdviceDec and AfterThrowingAdviceDec and AroundAdviceDec.


isAfterAdvice

protected boolean isAfterAdvice()

reverseSortOrder

protected boolean reverseSortOrder(AdviceDec a1,
                                   AdviceDec a2)

dominates

public boolean dominates(AdviceDec otherAdvice)

makePlanner

public org.aspectj.compiler.crosscuts.joinpoints.JpPlanner makePlanner(PlanData planData)
Specified by:
makePlanner in interface org.aspectj.compiler.crosscuts.joinpoints.JpPlannerMaker

wrapJoinPoint

public void wrapJoinPoint(org.aspectj.compiler.crosscuts.joinpoints.JoinPoint joinPoint,
                          org.aspectj.compiler.crosscuts.joinpoints.AdvicePlan plan)

wrapStmts

protected Stmts wrapStmts(Stmts stmts,
                          org.aspectj.compiler.crosscuts.joinpoints.AdvicePlan plan)

makeFormals

protected final Formals makeFormals()

getExtraArgType

public final Type getExtraArgType()

makeConcreteMethod

public MethodDec makeConcreteMethod()

makeMethodBody

protected CodeBody makeMethodBody()
returns the method body used for the java method corresponding to this advice this method body is my actual body in the AST, never a copy


finishMethodDec

protected void finishMethodDec(MethodDec methodDec)

getMethodDec

public MethodDec getMethodDec()

makeCall

public Expr makeCall(Expr parent,
                     Exprs baseExprs)

needsStaticEnclosingJoinPointFormal

public boolean needsStaticEnclosingJoinPointFormal()

needsStaticJoinPointFormal

public boolean needsStaticJoinPointFormal()

needsDynamicJoinPointFormal

public boolean needsDynamicJoinPointFormal()

needsCallSiteContext

public boolean needsCallSiteContext()

addJoinPointFormals

public void addJoinPointFormals(Formals formals)

makeJoinPointFormal

protected FormalDec makeJoinPointFormal(java.lang.String name)

makeJoinPointStaticPartFormal

protected FormalDec makeJoinPointStaticPartFormal(java.lang.String name)

setupFlowWalker

protected void setupFlowWalker(org.aspectj.compiler.base.FlowCheckerPass w)
Description copied from class: CodeDec
set up the flow walker, by adding implicit variables like thisJoinPoint, etc

Overrides:
setupFlowWalker in class CodeDec

postFixAST

public ASTObject postFixAST(org.aspectj.compiler.base.ASTFixerPass fixer)
Replace the advice with its corresponding MethodDec in the AspectDec

Overrides:
postFixAST in class ASTObject

makeBodyScope

protected org.aspectj.compiler.base.cst.BlockScope makeBodyScope(org.aspectj.compiler.base.cst.Scope parent)

preScope

public void preScope(ScopeWalker walker)
Overrides:
preScope in class CodeDec

checkSpec

public void checkSpec()
Overrides:
checkSpec in class CodeDec

getId

public java.lang.String getId()
Specified by:
getId in class CodeDec

getResultTypeD

public TypeD getResultTypeD()
Specified by:
getResultTypeD in class CodeDec

getReturnType

public Type getReturnType()

toShortString

public java.lang.String toShortString()
Specified by:
toShortString in interface org.aspectj.compiler.crosscuts.joinpoints.JpPlannerMaker
Specified by:
toShortString in class Dec

getAdviceKind

protected abstract java.lang.String getAdviceKind()

unparse

public void unparse(org.aspectj.compiler.base.CodeWriter writer)
Specified by:
unparse in interface AspectMember
Overrides:
unparse in class ASTObject

getPcd

public Pcd getPcd()

setPcd

public void setPcd(Pcd _pcd)

getChildAt

public ASTObject getChildAt(int childIndex)
Overrides:
getChildAt in class CodeDec

getChildNameAt

public java.lang.String getChildNameAt(int childIndex)
Overrides:
getChildNameAt in class CodeDec

setChildAt

public void setChildAt(int childIndex,
                       ASTObject child)
Overrides:
setChildAt in class CodeDec

getChildCount

public int getChildCount()
Overrides:
getChildCount in class CodeDec

getDefaultDisplayName

public java.lang.String getDefaultDisplayName()
Overrides:
getDefaultDisplayName in class CodeDec