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.

HasMemberTypePatternFinder.java 1.0KB

123456789101112131415161718192021222324252627282930313233
  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 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. * Adrian Colyer Initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.weaver.patterns;
  13. /**
  14. * @author colyer
  15. * usage : new HasMemberTypePatternFinder(pattern).hasMemberTypePattern()
  16. */
  17. public class HasMemberTypePatternFinder extends AbstractPatternNodeVisitor {
  18. private boolean hasMemberTypePattern = false;
  19. public HasMemberTypePatternFinder(TypePattern aPattern) {
  20. aPattern.traverse(this, null);
  21. }
  22. public Object visit(HasMemberTypePattern node, Object data) {
  23. hasMemberTypePattern = true;
  24. return null;
  25. }
  26. public boolean hasMemberTypePattern() { return hasMemberTypePattern; }
  27. }