View Javadoc

1   package net.sourceforge.pmd.lang.java.xpath;
2   
3   import net.sf.saxon.expr.XPathContext;
4   import net.sourceforge.pmd.lang.ast.Node;
5   import net.sourceforge.pmd.lang.ast.xpath.saxon.ElementNode;
6   
7   /**
8    * Exposes all Java Language specific functions for Saxon use.
9    */
10  public class JavaFunctions {
11  
12      public static boolean typeof(XPathContext context, String nodeTypeName, String fullTypeName) {
13      	return typeof(context, nodeTypeName, fullTypeName, null);
14      }
15  
16      public static boolean typeof(XPathContext context, String nodeTypeName, String fullTypeName, String shortTypeName) {
17      	return TypeOfFunction.typeof((Node) ((ElementNode) context.getContextItem()).getUnderlyingNode(), nodeTypeName,
18      			fullTypeName, shortTypeName);
19      }
20  }