View Javadoc

    1   /**
    2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
    3    */
    4   package net.sourceforge.pmd.lang.ast.xpath;
    5
    6   import net.sf.saxon.sxpath.IndependentContext;
    7   import net.sourceforge.pmd.lang.Language;
    8   import net.sourceforge.pmd.lang.XPathHandler;
    9
    10  import org.jaxen.Navigator;
    11
    12  public abstract class AbstractASTXPathHandler implements XPathHandler {
    13
    14      public Navigator getNavigator() {
    15  	return new DocumentNavigator();
    16      }
    17
    18      public void initialize(IndependentContext context, Language language, Class<?> functionsClass) {
    19  	context.declareNamespace("pmd-" + language.getTerseName(), "java:" + functionsClass.getName());
    20      }
    21  }