Examples of ImmutableNode


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

        }

        else
        {
            Iterator<ConfigData> it = configurations.iterator();
            ImmutableNode node = it.next().getTransformedRoot();
            while (it.hasNext())
            {
                node = nodeCombiner.combine(node,
                        it.next().getTransformedRoot());
            }
View Full Code Here

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

         *
         * @return the transformed root node
         */
        public ImmutableNode getTransformedRoot()
        {
            ImmutableNode configRoot = getRootNodeOfConfiguration();
            return (atPath == null) ? configRoot : prependAtPath(configRoot);
        }
View Full Code Here

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

        private ImmutableNode getRootNodeOfConfiguration()
        {
            getConfiguration().lock(LockMode.READ);
            try
            {
                ImmutableNode root =
                        ConfigurationUtils
                                .convertToHierarchical(getConfiguration(),
                                        conversionExpressionEngine).getNodeModel()
                                .getInMemoryRepresentation();
                rootNode = root;
View Full Code Here

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

    private AbstractHierarchicalConfiguration<ImmutableNode> config;

    @Before
    public void setUp() throws Exception
    {
        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.ImmutableNode

     */
    @Test
    public void testAddNodesForNonExistingKey()
    {
        Collection<ImmutableNode> nodes = new ArrayList<ImmutableNode>();
        ImmutableNode newNode =
                new ImmutableNode.Builder().name("usr").value("scott")
                        .addAttribute("pwd", "tiger").create();
        nodes.add(newNode);
        config.addNodes("database.connection.settings", nodes);

View Full Code Here

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

     */
    @Test
    public void testNodeKeyEmptyCache()
    {
        Map<ImmutableNode, String> cache = new HashMap<ImmutableNode, String>();
        ImmutableNode nodeTabName =
                NodeStructureHelper.nodeForKey(getRootNode(),
                        "tables/table(0)/name");
        ImmutableNode nodeFldName =
                NodeStructureHelper.nodeForKey(getRootNode(),
                        "tables/table(0)/fields/field(1)/name");
        assertEquals("Wrong key (1)", "tables(0).table(0).name(0)",
                config.nodeKey(nodeTabName, cache, config.getModel()
                        .getNodeHandler()));
View Full Code Here

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

     */
    @Test
    public void testNodeKeyCachePopulated()
    {
        Map<ImmutableNode, String> cache = new HashMap<ImmutableNode, String>();
        ImmutableNode nodeTabName =
                NodeStructureHelper.nodeForKey(getRootNode(),
                        "tables/table(0)/name");
        NodeHandler<ImmutableNode> handler = config.getModel().getNodeHandler();
        config.nodeKey(nodeTabName, cache, handler);
        assertEquals("Wrong number of elements", 4, cache.size());
View Full Code Here

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

     */
    @Test
    public void testNodeKeyCacheUsage()
    {
        Map<ImmutableNode, String> cache = new HashMap<ImmutableNode, String>();
        ImmutableNode nodeTabName =
                NodeStructureHelper.nodeForKey(getRootNode(),
                        "tables/table(0)/name");
        NodeHandler<ImmutableNode> handler = config.getModel().getNodeHandler();
        cache.put(handler.getParent(nodeTabName), "somePrefix");
        assertEquals("Wrong key", "somePrefix.name(0)",
View Full Code Here

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

        config.setSynchronizer(sync);
        NodeModel<ImmutableNode> model = config.getNodeModel();

        assertTrue("Wrong node model: " + model,
                model instanceof InMemoryNodeModel);
        ImmutableNode rootNode = model.getNodeHandler().getRootNode();
        assertEquals("Wrong number of children of root node", 1, rootNode
                .getChildren().size());
        assertTrue("Wrong children of root node", rootNode.getChildren()
                .contains(NodeStructureHelper.ROOT_TABLES_TREE));
        sync.verify(SynchronizerTestImpl.Methods.BEGIN_READ,
                SynchronizerTestImpl.Methods.END_READ);
    }
View Full Code Here

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

                elemRefs ? new HashMap<ImmutableNode, Object>() : null;
        Map<String, String> attributes =
                constructHierarchy(rootBuilder, rootValue,
                        document.getDocumentElement(), elemRefMap, true, 0);
        attributes.remove(ATTR_SPACE_INTERNAL);
        ImmutableNode top =
                rootBuilder.value(rootValue.getValue())
                        .addAttributes(attributes).create();
        getSubConfigurationParentModel().mergeRoot(top,
                document.getDocumentElement().getTagName(), elemRefMap,
                elemRefs ? docHelper : null, this);
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.