List of usage examples for org.apache.commons.jxpath PackageFunctions PackageFunctions
public PackageFunctions(String classPrefix, String namespace)
From source file:org.apache.cocoon.components.modules.input.JXPathHelperConfiguration.java
/** * Create root jxpath configuration//from www. jav a 2s.c om */ public JXPathHelperConfiguration(Configuration config) throws ConfigurationException { this.lenient = config.getChild("lenient").getValueAsBoolean(true); this.library = new FunctionLibrary(); setup(config); // the following is necessary to be able to use methods on objects without // explicitely registering extension functions (see PackageFunctions javadoc) this.library.addFunctions(new PackageFunctions("", null)); }
From source file:org.apache.cocoon.components.modules.input.JXPathHelperConfiguration.java
/** * Register all extension packages listed in the configuration * through <code><package name="fully.qualified.package" * prefix="prefix"/></code> in the given FunctionLibrary. * * @param conf a <code>Configuration</code> value */// ww w .j a v a 2s.c o m private void getPackages(Configuration conf) { Configuration[] children = conf.getChildren("package"); int i = children.length; while (i-- > 0) { String packageName = children[i].getAttribute("name", null); String prefix = children[i].getAttribute("prefix", null); if (packageName != null && prefix != null) { this.library.addFunctions(new PackageFunctions(packageName, prefix)); } } }