Examples of XPathExpressionEngine


Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

    try {
      xmlConfig.load(new StringReader(w.toString()));
    } catch (ConfigurationException e) {
      throw new JibeRuntimeException(e);
    }
    xmlConfig.setExpressionEngine(new XPathExpressionEngine());
    cc.setConfiguration(xmlConfig);
    return cc;
  }
View Full Code Here

Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

    NodeCombiner combiner = new UnionCombiner();
    CombinedConfiguration cc = new CombinedConfiguration(combiner);
    cc.addConfiguration(conf1);
    cc.addConfiguration(conf2);
    ConfigurationConfig combined = new ConfigurationConfig();
    cc.setExpressionEngine(new XPathExpressionEngine());
    combined.configuration = cc;
    return combined;
  }
View Full Code Here

Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

  private java.util.List<String> parseConfigFile() {
    java.util.List<String> values = new ArrayList();

    try {
      final XMLConfiguration initial = new XMLConfiguration(gui.getConfig().getProperty("genericconffile"));
      initial.setExpressionEngine(new XPathExpressionEngine());
     
      for (final HierarchicalConfiguration subconf : (java.util.List<HierarchicalConfiguration>)
          initial.configurationsAt("/generic/template")) {
        final String name = subconf.getString("name");
        if (name != null) values.add(name);
View Full Code Here

Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

  private Map<String, String> parseConfigFile(final String name) {
    Map<String, String> values = new HashMap();

    try {
      final XMLConfiguration initial = new XMLConfiguration(gui.getConfig().getProperty("genericconffile"));
      initial.setExpressionEngine(new XPathExpressionEngine());

      for (final HierarchicalConfiguration subconf : (java.util.List<HierarchicalConfiguration>)
          initial.configurationsAt("/generic/template")) {
        final String subconf_name = subconf.getString("name");
        if (subconf_name != null && subconf_name.equals(name)) {
View Full Code Here

Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

    public void testMerge() throws ConfigurationException
    {
        //combiner.setDebugStream(System.out);
        HierarchicalConfiguration config = createCombinedConfiguration();
        config.setExpressionEngine(new XPathExpressionEngine());
        assertEquals("Wrong number of Channels", 3, config.getMaxIndex("Channels/Channel"));
        assertEquals("Bad Channel 1 Name", "My Channel",
                config.getString("Channels/Channel[@id='1']/Name"));
        assertEquals("Bad Channel Type", "half",
                config.getString("Channels/Channel[@id='1']/@type"));
View Full Code Here

Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

    /**
     * Tests changing the expression engine.
     */
    public void testSetExpressionEngine()
    {
        parent.setExpressionEngine(new XPathExpressionEngine());
        setUpSubnodeConfig();
        assertEquals("Wrong field name", TABLE_FIELDS[0][1], config
                .getString("fields/field[2]/name"));
        Set keys = new HashSet();
        CollectionUtils.addAll(keys, config.getKeys());
View Full Code Here

Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

     * changed for the parent.
     */
    public void testParentChangeDetatchException()
    {
        config = parent.configurationAt("tables.table(1)", true);
        parent.setExpressionEngine(new XPathExpressionEngine());
        assertEquals("Wrong name of table", TABLE_NAMES[1], config
                .getString("name"));
        assertNull("Sub config was not detached", config.getSubnodeKey());
    }
View Full Code Here

Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

    private static final int LOOP_COUNT = 100;

    public void testConfiguration() throws Exception
    {
        DynamicCombinedConfiguration config = new DynamicCombinedConfiguration();
        XPathExpressionEngine engine = new XPathExpressionEngine();
        config.setExpressionEngine(engine);
        config.setKeyPattern(PATTERN);
        config.setDelimiterParsingDisabled(true);
        MultiFileHierarchicalConfiguration multi = new MultiFileHierarchicalConfiguration(PATTERN1);
        multi.setExpressionEngine(engine);
View Full Code Here

Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

        FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
        strategy.setRefreshDelay(10000);

        PatternSubtreeConfigurationWrapper config = new PatternSubtreeConfigurationWrapper(this.conf, PATTERN);
        config.setReloadingStrategy(strategy);
        config.setExpressionEngine(new XPathExpressionEngine());

        System.setProperty("Id", "1001");
        assertTrue(config.getInt("rowsPerPage") == 15);

        System.setProperty("Id", "1002");
View Full Code Here

Examples of org.apache.commons.configuration.tree.xpath.XPathExpressionEngine

        assertEquals("a\\,b\\,c", conf2.getString("split.list4[@values]"));
        assertEquals("a,b,c", conf2.getString("split.list1"));
        assertEquals(0, conf2.getMaxIndex("split.list1"));
        assertEquals("a\\,b\\,c", conf2.getString("split.list2"));
        conf2 = new XMLConfiguration();
        conf2.setExpressionEngine(new XPathExpressionEngine());
        conf2.setDelimiterParsingDisabled(true);
        conf2.setFile(new File(testProperties));
        conf2.load();

        assertEquals("a,b,c", conf2.getString("split/list3/@values"));
View Full Code Here
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.