Package codeStatistics.xpathfunctions

Source Code of codeStatistics.xpathfunctions.FunctionUtils

package codeStatistics.xpathfunctions;

import net.sf.saxon.s9api.ItemTypeFactory;
import net.sf.saxon.s9api.OccurrenceIndicator;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.QName;
import net.sf.saxon.s9api.SequenceType;
import net.sf.saxon.s9api.XPathCompiler;

public class FunctionUtils {
  public static final String NAMESPACE = "http://www.mimuw.edu.pl/~kjk/CodeStatistics";
 
  public static SequenceType createZeroOrOneResultType(ItemTypeFactory typeFactory, Class<?> clazz) {
    return SequenceType.makeSequenceType(typeFactory.getExternalObjectType(clazz),
        OccurrenceIndicator.ZERO_OR_ONE);
  }

  public static QName getName(String name){
        return new QName(NAMESPACE, name);
  }
 
  public static XPathCompiler createCompiler(Processor proc){
    XPathCompiler result = proc.newXPathCompiler();
    result.declareNamespace("cs", FunctionUtils.NAMESPACE);
    return result;
  }
 
}
TOP

Related Classes of codeStatistics.xpathfunctions.FunctionUtils

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.