Class RegexFilter<E extends CtElement>

java.lang.Object
spoon.reflect.visitor.filter.RegexFilter<E>
All Implemented Interfaces:
Filter<E>

public class RegexFilter<E extends CtElement> extends Object implements Filter<E>
Filters elements with a regular expression on the element's code. Example:
 CtFieldAccess thisAccess = type.getElements(new ExpressionFilter("this"))
                .get(0);
 
  • Constructor Details

    • RegexFilter

      public RegexFilter(String regex)
  • Method Details

    • matches

      public boolean matches(E element)
      Description copied from interface: Filter
      Tells if the given element matches.
      Specified by:
      matches in interface Filter<E extends CtElement>
      Parameters:
      element - - the element to be checked for a match. Parameter element is never null if Query is used.
    • getType

      public Class<CtElement> getType()