public KeysConfig(String optionalConfigPath) throws FileNotFoundException, ConfigurationException { File file = locate(optionalConfigPath); configFile = (T) ConfigurationUtils.convertToHierarchical(new PropertiesConfiguration(file)); configFile.setExpressionEngine(new XPathExpressionEngine()); }
private IImporterHandler[] loadImportHandlers( XMLConfiguration xml, String xmlPath) { List<IImporterHandler> handlers = new ArrayList<>(); ExpressionEngine originalEngine = xml.getExpressionEngine(); xml.setExpressionEngine(new XPathExpressionEngine()); List<HierarchicalConfiguration> xmlHandlers = xml.configurationsAt(xmlPath + "/*"); xml.setExpressionEngine(originalEngine); for (HierarchicalConfiguration xmlHandler : xmlHandlers) { xmlHandler.setExpressionEngine(originalEngine); IImporterHandler handler = XMLConfigurationUtil.newInstance(xmlHandler); if (handler != null) { handlers.add(handler); //TODO throw exception here? } } if (handlers.isEmpty()) { return null; } return handlers.toArray(new IImporterHandler[]{}); }
DefaultConfigurationBuilder.ADDITIONAL_NAME); generalConfig.setExpressionEngine(new XPathExpressionEngine()); return generalConfig; } catch (ConfigurationException e) {
hc.setExpressionEngine(engine); if (engine != null) hc.setExpressionEngine(engine);
hc.setExpressionEngine(engine); if (engine != null) hc.setExpressionEngine(engine);