You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PointcutBasedPerClauseImpl.java 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. import org.aspectj.lang.reflect.PerClauseKind;
  14. import org.aspectj.lang.reflect.PointcutBasedPerClause;
  15. import org.aspectj.lang.reflect.PointcutExpression;
  16. /**
  17. * @author colyer
  18. *
  19. */
  20. public class PointcutBasedPerClauseImpl extends PerClauseImpl implements
  21. PointcutBasedPerClause {
  22. private final PointcutExpression pointcutExpression;
  23. public PointcutBasedPerClauseImpl(PerClauseKind kind,
  24. String pointcutExpression) {
  25. super(kind);
  26. this.pointcutExpression = new PointcutExpressionImpl(pointcutExpression);
  27. }
  28. public PointcutExpression getPointcutExpression() {
  29. return pointcutExpression;
  30. }
  31. public String toString() {
  32. StringBuffer sb = new StringBuffer();
  33. switch(getKind()) {
  34. case PERCFLOW: sb.append("percflow("); break;
  35. case PERCFLOWBELOW: sb.append("percflowbelow("); break;
  36. case PERTARGET: sb.append("pertarget("); break;
  37. case PERTHIS: sb.append("perthis("); break;
  38. }
  39. sb.append(this.pointcutExpression.asString());
  40. sb.append(")");
  41. return sb.toString();
  42. }
  43. }