Examples of ImmutableNode


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

            // display the children
            Iterator<ImmutableNode> it = children.iterator();
            while (it.hasNext())
            {
                ImmutableNode child = it.next();

                printNode(out, indentLevel + 1, child, handler);

                // add a semi colon for elements that are not dictionaries
                Object value = child.getValue();
                if (value != null && !(value instanceof Map) && !(value instanceof Configuration))
                {
                    out.println(";");
                }
View Full Code Here

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

            Configuration config = (Configuration) value;
            Iterator<String> it = config.getKeys();
            while (it.hasNext())
            {
                String key = it.next();
                ImmutableNode node =
                        new ImmutableNode.Builder().name(key)
                                .value(config.getProperty(key)).create();
                InMemoryNodeModel tempModel = new InMemoryNodeModel(node);
                printNode(out, indentLevel + 1, node, tempModel.getNodeHandler());
                out.println(";");
View Full Code Here

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

    throw new Error("Missing return statement in function");
  }

  final public PropertyListConfiguration Dictionary() throws ParseException {
    ImmutableNode.Builder builder = new ImmutableNode.Builder();
    ImmutableNode child = null;
    jj_consume_token(DICT_BEGIN);
    label_1:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case STRING:
      case QUOTED_STRING:
        ;
        break;
      default:
        jj_la1[0] = jj_gen;
        break label_1;
      }
      child = Property();
            if (child.getValue() instanceof HierarchicalConfiguration)
            {
                // prune & graft the nested configuration to the parent configuration
                @SuppressWarnings("unchecked") // we created this configuration
                HierarchicalConfiguration<ImmutableNode> conf =
                    (HierarchicalConfiguration<ImmutableNode>) child.getValue();
                ImmutableNode root = conf.getNodeModel().getNodeHandler().getRootNode();
                ImmutableNode.Builder childBuilder = new ImmutableNode.Builder();
                childBuilder.name(child.getNodeName()).value(root.getValue())
                  .addChildren(root.getChildren());
                builder.addChild(childBuilder.create());
            }
            else
            {
                builder.addChild(child);
View Full Code Here

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

            out.println(padding + "<dict>");

            Iterator<ImmutableNode> it = children.iterator();
            while (it.hasNext())
            {
                ImmutableNode child = it.next();
                printNode(out, indentLevel + 1, child);

                if (it.hasNext())
                {
                    out.println();
View Full Code Here

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

            Iterator<String> it = config.getKeys();
            while (it.hasNext())
            {
                // create a node for each property
                String key = it.next();
                ImmutableNode node =
                        new ImmutableNode.Builder().name(key)
                                .value(config.getProperty(key)).create();

                // print the node
                printNode(out, indentLevel + 1, node);
View Full Code Here

Examples of org.apache.commons.configuration.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

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

                Map<String, String> attrmap =
                        constructHierarchy(childNode, refChildValue, child,
                                elemRefs, trimFlag, level + 1);
                Boolean childTrim = Boolean.valueOf(attrmap.remove(ATTR_SPACE_INTERNAL));
                childNode.addAttributes(attrmap);
                ImmutableNode newChild =
                        createChildNodeWithValue(node, childNode,
                                refChildValue.getValue(),
                                childTrim.booleanValue(), attrmap);
                if (elemRefs != null)
                {
View Full Code Here

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

        BufferedReader bufferedReader = new BufferedReader(in);
        Map<String, ImmutableNode.Builder> sectionBuilders = new LinkedHashMap<String, ImmutableNode.Builder>();
        ImmutableNode.Builder rootBuilder = new ImmutableNode.Builder();

        createNodeBuilders(bufferedReader, rootBuilder, sectionBuilders);
        ImmutableNode rootNode = createNewRootNode(rootBuilder, sectionBuilders);
        addNodes(null, rootNode.getChildren());
    }
View Full Code Here

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

    private BaseHierarchicalConfiguration config;

    @Before
    public void setUp() throws Exception
    {
        ImmutableNode root =
                new ImmutableNode.Builder(1).addChild(
                        NodeStructureHelper.ROOT_TABLES_TREE).create();
        config = new BaseHierarchicalConfiguration();
        config.getNodeModel().setRootNode(root);
    }
View Full Code Here

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

     * Tests whether addNodes() is correctly synchronized.
     */
    @Test
    public void testAddNodesSynchronized()
    {
        ImmutableNode node = NodeStructureHelper.createNode("newNode", "true");
        config.addNodes("test.addNodes", Collections.singleton(node));
        sync.verify(Methods.BEGIN_WRITE, Methods.END_WRITE);
    }
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.