01 package net.sourceforge.pmd.lang.java.xpath;
02
03 import net.sf.saxon.expr.XPathContext;
04 import net.sourceforge.pmd.lang.ast.Node;
05 import net.sourceforge.pmd.lang.ast.xpath.saxon.ElementNode;
06
07 /**
08 * Exposes all Java Language specific functions for Saxon use.
09 */
10 public class JavaFunctions {
11 public static boolean typeof(XPathContext context, String nodeTypeName, String fullTypeName) {
12 return typeof(context, nodeTypeName, fullTypeName, null);
13 }
14
15 public static boolean typeof(XPathContext context, String nodeTypeName, String fullTypeName, String shortTypeName) {
16 return TypeOfFunction.typeof((Node) ((ElementNode) context.getContextItem()).getUnderlyingNode(), nodeTypeName,
17 fullTypeName, shortTypeName);
18 }
19 }
|