KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > internal > lang > reflect > PointcutBasedPerClauseImpl


1 /* *******************************************************************
2  * Copyright (c) 2005 Contributors.
3  * All rights reserved.
4  * This program and the accompanying materials are made available
5  * under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution and is available at
7  * http://eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Adrian Colyer Initial implementation
11  * ******************************************************************/

12 package org.aspectj.internal.lang.reflect;
13
14 import org.aspectj.lang.reflect.PerClauseKind;
15 import org.aspectj.lang.reflect.PointcutBasedPerClause;
16 import org.aspectj.lang.reflect.PointcutExpression;
17
18 /**
19  * @author colyer
20  *
21  */

22 public class PointcutBasedPerClauseImpl extends PerClauseImpl implements
23         PointcutBasedPerClause {
24
25     private final PointcutExpression pointcutExpression;
26
27     public PointcutBasedPerClauseImpl(PerClauseKind kind,
28             String JavaDoc pointcutExpression) {
29         super(kind);
30         this.pointcutExpression = new PointcutExpressionImpl(pointcutExpression);
31     }
32     
33     public PointcutExpression getPointcutExpression() {
34         return pointcutExpression;
35     }
36
37     public String JavaDoc toString() {
38         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
39         switch(getKind()) {
40         case PERCFLOW: sb.append("percflow("); break;
41         case PERCFLOWBELOW: sb.append("percflowbelow("); break;
42         case PERTARGET: sb.append("pertarget("); break;
43         case PERTHIS: sb.append("perthis("); break;
44         }
45         sb.append(this.pointcutExpression.asString());
46         sb.append(")");
47         return sb.toString();
48     }
49 }
50
Popular Tags