Examples of InMemoryNodeModel


Examples of org.apache.commons.configuration.tree.InMemoryNodeModel

     * original and copied configurations are independent on each other.
     */
    @Override
    protected NodeModel<ImmutableNode> cloneNodeModel()
    {
        return new InMemoryNodeModel(getModel().getNodeHandler().getRootNode());
    }
View Full Code Here

Examples of org.apache.commons.configuration.tree.InMemoryNodeModel

     */
    private static NodeModel<ImmutableNode> createNodeModel(
            HierarchicalConfiguration<ImmutableNode> c)
    {
        ImmutableNode root = (c != null) ? obtainRootNode(c) : null;
        return new InMemoryNodeModel(root);
    }
View Full Code Here

Examples of org.apache.commons.configuration2.tree.InMemoryNodeModel

     * @param selector the selector
     * @return the tracked model
     */
    private TrackedNodeModel setUpTrackedModel(NodeSelector selector)
    {
        InMemoryNodeModel parentModel = (InMemoryNodeModel) parent.getModel();
        parentModel.trackNode(selector, parent);
        return new TrackedNodeModel(parent, selector, true);
    }
View Full Code Here

Examples of org.apache.commons.configuration2.tree.InMemoryNodeModel

        setUpSubnodeConfig();
        SubnodeConfiguration copy = (SubnodeConfiguration) config.clone();
        assertNotSame("Same model", config.getModel(), copy.getModel());
        TrackedNodeModel subModel = (TrackedNodeModel) copy.getModel();
        assertEquals("Wrong selector", SELECTOR, subModel.getSelector());
        InMemoryNodeModel parentModel = (InMemoryNodeModel) parent.getModel();
        assertEquals("Wrong parent model", parentModel,
                subModel.getParentModel());

        // Check whether the track count was increased
        parentModel.untrackNode(SELECTOR);
        parentModel.untrackNode(SELECTOR);
        assertTrue("Wrong finalize flag",
                subModel.isReleaseTrackedNodeOnFinalize());
    }
View Full Code Here

Examples of org.apache.commons.configuration2.tree.InMemoryNodeModel

            }
            catch (ConfigurationRuntimeException iex)
            {
                // the passed in key does not map to exactly one node
                // obtain the node for the section, create it on demand
                InMemoryNodeModel parentModel = getSubConfigurationParentModel();
                NodeSelector selector = parentModel.trackChildNodeWithCreation(null, name, this);
                return createSubConfigurationForTrackedNode(selector, this);
            }
        }
    }
View Full Code Here

Examples of org.apache.commons.configuration2.tree.InMemoryNodeModel

     *
     * @return the sub configuration for the global section
     */
    private SubnodeConfiguration getGlobalSection()
    {
        InMemoryNodeModel parentModel = getSubConfigurationParentModel();
        NodeSelector selector = new NodeSelector(null); // selects parent
        parentModel.trackNode(selector, this);
        GlobalSectionNodeModel model =
                new GlobalSectionNodeModel(this, selector);
        SubnodeConfiguration sub = new SubnodeConfiguration(this, model);
        initSubConfigurationForThisParent(sub);
        return sub;
View Full Code Here

Examples of org.apache.commons.configuration2.tree.InMemoryNodeModel

        ImmutableNode root =
                new ImmutableNode.Builder(1).addChild(
                        NodeStructureHelper.ROOT_TABLES_TREE).create();
        config =
                new AbstractHierarchicalConfigurationTestImpl(
                        new InMemoryNodeModel(root));
    }
View Full Code Here

Examples of org.apache.commons.configuration2.tree.InMemoryNodeModel

    @Test
    public void testIsEmptyRootOnly()
    {
        config =
                new AbstractHierarchicalConfigurationTestImpl(
                        new InMemoryNodeModel());
        assertTrue("Not empty", config.isEmpty());
    }
View Full Code Here

Examples of org.apache.commons.configuration2.tree.InMemoryNodeModel

        ImmutableNode.Builder nodeBuilder = new ImmutableNode.Builder(1);
        nodeBuilder.addChild(NodeStructureHelper.createNode("child", null));
        rootBuilder.addChild(nodeBuilder.create());
        config =
                new AbstractHierarchicalConfigurationTestImpl(
                        new InMemoryNodeModel(rootBuilder.create()));
        assertTrue("Not empty", config.isEmpty());
    }
View Full Code Here

Examples of org.apache.commons.configuration2.tree.InMemoryNodeModel

    @Test
    public void testAddNodesCopy()
    {
        AbstractHierarchicalConfigurationTestImpl configDest =
                new AbstractHierarchicalConfigurationTestImpl(
                        new InMemoryNodeModel());
        configDest.addProperty("test", "TEST");
        Collection<ImmutableNode> nodes = getRootNode().getChildren();
        assertEquals("Wrong number of children", 1, nodes.size());
        configDest.addNodes("newNodes", nodes);
        for (int i = 0; i < NodeStructureHelper.tablesLength(); i++)
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.