Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

NameBindingPointcut.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver.patterns;
  13. import java.util.List;
  14. import org.aspectj.weaver.ResolvedType;
  15. import org.aspectj.weaver.World;
  16. import org.aspectj.weaver.ast.Test;
  17. import org.aspectj.weaver.ast.Var;
  18. /**
  19. * Common super type for Pointcuts that can bind formal parameters.
  20. *
  21. * @author Erik Hilsdale
  22. * @author Jim Hugunin
  23. */
  24. public abstract class NameBindingPointcut extends Pointcut {
  25. public NameBindingPointcut() {
  26. super();
  27. }
  28. protected Test exposeStateForVar(Var var,TypePattern type, ExposedState state, World world) {
  29. if (type instanceof BindingTypePattern) {
  30. BindingTypePattern b = (BindingTypePattern)type;
  31. state.set(b.getFormalIndex(), var);
  32. }
  33. ResolvedType myType = type.getExactType().resolve(world);
  34. if (myType.isParameterizedType()) {
  35. // unchecked warning already issued...
  36. myType = myType.getRawType();
  37. }
  38. return Test.makeInstanceof(var, myType.resolve(world));
  39. }
  40. public abstract List<BindingTypePattern> getBindingTypePatterns();
  41. public abstract List<BindingPattern> getBindingAnnotationTypePatterns();
  42. }