1 24 25 package org.aspectj.compiler.crosscuts.ast; 26 27 import org.aspectj.compiler.base.ast.*; 28 import org.aspectj.compiler.crosscuts.joinpoints.*; 29 30 import org.aspectj.compiler.base.JavaCompiler; 31 32 35 36 public class AfterAdviceDec extends AdviceDec { 37 38 protected String getAdviceKind() { return "after"; } 39 40 protected boolean isAfterAdvice() { return true; } 41 42 protected Stmts wrapStmts(Stmts stmts, AdvicePlan plan) { 43 final AST ast = getAST(); 44 45 return ast.makeStmts( 46 ast.makeTryFinally(ast.makeBlock(stmts), ast.makeBlock(plan.makeCall(null)))); 47 } 48 49 51 public AfterAdviceDec(SourceLocation location, Modifiers _modifiers, Formals _formals, TypeDs __throws, Pcd _pcd, CodeBody _body) { 52 super(location, _modifiers, _formals, __throws, _pcd, _body); 53 54 } 55 protected AfterAdviceDec(SourceLocation source) { 56 super(source); 57 } 58 59 public ASTObject copyWalk(CopyWalker walker) { 60 AfterAdviceDec ret = new AfterAdviceDec(getSourceLocation()); 61 ret.preCopy(walker, this); 62 if (modifiers != null) ret.setModifiers( (Modifiers)walker.process(modifiers) ); 63 if (formals != null) ret.setFormals( (Formals)walker.process(formals) ); 64 if (_throws != null) ret.setThrows( (TypeDs)walker.process(_throws) ); 65 if (pcd != null) ret.setPcd( (Pcd)walker.process(pcd) ); 66 if (body != null) ret.setBody( (CodeBody)walker.process(body) ); 67 return ret; 68 } 69 70 71 public String getDefaultDisplayName() { 72 return "AfterAdviceDec()"; 73 } 74 75 } 77 | Popular Tags |