abc.aspectj.ast
Class AdviceDecl_c

java.lang.Object
  extended by MethodDecl_c
      extended by abc.aspectj.extension.AJMethodDecl_c
          extended by abc.aspectj.ast.AdviceBody_c
              extended by abc.aspectj.ast.AdviceDecl_c
All Implemented Interfaces:
AdviceDecl, MakesAspectMethods, ContainsAspectInfo, TransformsAspectReflection
Direct Known Subclasses:
AdviceDecl_c, EAJAdviceDecl_c, PerSymbolAdviceDecl_c

public class AdviceDecl_c
extends AdviceBody_c

Declarations of advice, for example before(int x) // the "advice spec" : call(* fac(*)) && args(x) // pointcut { System.out.println(x);} // body

Author:
Oege de Moor, Aske Simon Christensen

Field Summary
protected  Pointcut pc
          pointcut that specifies the joinpoints where this advice applies
protected  AdviceFormal retval
          the return formal, for afterreturning and afterthrowing advice
protected  AdviceSpec spec
          advice specification (e.g.
 
Fields inherited from class abc.aspectj.ast.AdviceBody_c
canRewriteThisJoinPoint, hasEnclosingJoinPointStaticPart, hasJoinPoint, hasJoinPointStaticPart, isAroundAdvice, methodsInAdvice, thisEnclosingJoinPointStaticPartInstance, thisJoinPointInstance, thisJoinPointStaticPartInstance
 
Constructor Summary
AdviceDecl_c(Position pos, Flags flags, AdviceSpec spec, java.util.List throwTypes, Pointcut pc, Block body)
           
 
Method Summary
 java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
          Visit this term in evaluation order.
protected  void addExtraFormals(AJNodeFactory nf, AJTypeSystem ts, java.util.List formals, java.util.List formalTypes)
           
protected  java.lang.String adviceSignature()
           
 NodeVisitor disambiguateEnter(AmbiguityRemover ar)
           
 Context enterScope(Node child, Context c)
           
 Term entry()
           
 void prettyPrint(CodeWriter w, PrettyPrinter tr)
           
 MethodDecl proceedDecl(AJNodeFactory nf, AJTypeSystem ts)
          generate a dummy MethodDecl for the proceed.
protected  AdviceDecl_c reconstruct(TypeNode returnType, java.util.List formals, java.util.List throwTypes, Block body, AdviceSpec spec, AdviceFormal retval, Pointcut pc)
           
 Node typeCheck(TypeChecker tc)
          Type check the advice: first the usual method checks, then whether the "throwing" result is actually throwable
 void update(GlobalAspectInfo gai, Aspect current_aspect)
          Called by the AspectInfoHarvester to tell the node to put all relevant information into the GlobalAspectInfo.
 Node visitChildren(NodeVisitor v)
           
 
Methods inherited from class abc.aspectj.ast.AdviceBody_c
aspectMethodsEnter, aspectMethodsLeave, buildTypes, dummyVal, enterAspectReflectionInspect, enterAspectReflectionRewrite, enterScope, hasEnclosingJoinPointStaticPart, hasJoinPoint, hasJoinPointStaticPart, joinpointFormals, leaveAspectReflectionInspect, leaveAspectReflectionRewrite, localMethod, makeMethodInstance, methodDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spec

protected AdviceSpec spec
advice specification (e.g. before(formals), around(..), after returning(..) )


pc

protected Pointcut pc
pointcut that specifies the joinpoints where this advice applies


retval

protected AdviceFormal retval
the return formal, for afterreturning and afterthrowing advice

Constructor Detail

AdviceDecl_c

public AdviceDecl_c(Position pos,
                    Flags flags,
                    AdviceSpec spec,
                    java.util.List throwTypes,
                    Pointcut pc,
                    Block body)
Method Detail

reconstruct

protected AdviceDecl_c reconstruct(TypeNode returnType,
                                   java.util.List formals,
                                   java.util.List throwTypes,
                                   Block body,
                                   AdviceSpec spec,
                                   AdviceFormal retval,
                                   Pointcut pc)

visitChildren

public Node visitChildren(NodeVisitor v)

disambiguateEnter

public NodeVisitor disambiguateEnter(AmbiguityRemover ar)
                              throws SemanticException
Overrides:
disambiguateEnter in class AdviceBody_c
Throws:
SemanticException

proceedDecl

public MethodDecl proceedDecl(AJNodeFactory nf,
                              AJTypeSystem ts)
Description copied from interface: AdviceDecl
generate a dummy MethodDecl for the proceed. Only applies to around advice.

Specified by:
proceedDecl in interface AdviceDecl
Overrides:
proceedDecl in class AdviceBody_c

addExtraFormals

protected void addExtraFormals(AJNodeFactory nf,
                               AJTypeSystem ts,
                               java.util.List formals,
                               java.util.List formalTypes)
Overrides:
addExtraFormals in class AdviceBody_c

adviceSignature

protected java.lang.String adviceSignature()
Specified by:
adviceSignature in class AdviceBody_c

enterScope

public Context enterScope(Node child,
                          Context c)
Overrides:
enterScope in class AdviceBody_c

typeCheck

public Node typeCheck(TypeChecker tc)
               throws SemanticException
Type check the advice: first the usual method checks, then whether the "throwing" result is actually throwable

Overrides:
typeCheck in class AdviceBody_c
Throws:
SemanticException

prettyPrint

public void prettyPrint(CodeWriter w,
                        PrettyPrinter tr)
Specified by:
prettyPrint in class AdviceBody_c

update

public void update(GlobalAspectInfo gai,
                   Aspect current_aspect)
Description copied from interface: ContainsAspectInfo
Called by the AspectInfoHarvester to tell the node to put all relevant information into the GlobalAspectInfo.

Parameters:
gai - the target of the information.
current_aspect - the aspect currently being traversed.

entry

public Term entry()
Overrides:
entry in class AdviceBody_c

acceptCFG

public java.util.List acceptCFG(CFGBuilder v,
                                java.util.List succs)
Visit this term in evaluation order.