use of net.sourceforge.pmd.lang.xpath.MatchesFunction in project pmd by pmd.
the class MatchesFunctionTest method tryRegexp.
private Object tryRegexp(MyNode myNode, String exp) throws FunctionCallException, NoSuchMethodException {
MatchesFunction function = new MatchesFunction();
List<Object> list = new ArrayList<>();
List<Attribute> attrs = new ArrayList<>();
attrs.add(new Attribute(myNode, "matches", myNode.getClass().getMethod("getClassName", new Class[0])));
list.add(attrs);
list.add(exp);
Context c = new Context(null);
c.setNodeSet(new ArrayList<>());
return function.call(c, list);
}
Aggregations