public void endElement()

in src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java [351:414]


        public void endElement(final String uri, final String localName, final String qName) throws SAXException {
            if ("key".equals(qName)) {
                // create a new node, link it to its parent and push it on the stack
                final PListNodeBuilder node = new PListNodeBuilder();
                node.setName(buffer.toString());
                peekNE().addChild(node);
                push(node);
            } else if ("dict".equals(qName)) {
                // remove the root of the XMLPropertyListConfiguration previously pushed on the stack
                final PListNodeBuilder builder = pop();
                assert builder != null : "Stack was empty!";
                if (peek() instanceof ArrayNodeBuilder) {
                    // create the configuration
                    final XMLPropertyListConfiguration config = new XMLPropertyListConfiguration(builder.createNode());

                    // add it to the ArrayNodeBuilder
                    final ArrayNodeBuilder node = (ArrayNodeBuilder) peekNE();
                    node.addValue(config);
                }
            } else {
                switch (qName) {
                case "string":
                    peekNE().addValue(buffer.toString());
                    break;
                case "integer":
                    peekNE().addIntegerValue(buffer.toString());
                    break;
                case "real":
                    peekNE().addRealValue(buffer.toString());
                    break;
                case "true":
                    peekNE().addTrueValue();
                    break;
                case "false":
                    peekNE().addFalseValue();
                    break;
                case "data":
                    peekNE().addDataValue(buffer.toString());
                    break;
                case "date":
                    try {
                        peekNE().addDateValue(buffer.toString());
                    } catch (final IllegalArgumentException iex) {
                        getLogger().warn("Ignoring invalid date property " + buffer);
                    }
                    break;
                case "array": {
                    final ArrayNodeBuilder array = (ArrayNodeBuilder) pop();
                    peekNE().addList(array);
                    break;
                }
                default:
                    break;
                }

                // remove the plist node on the stack once the value has been parsed,
                // array nodes remains on the stack for the next values in the list
                if (!(peek() instanceof ArrayNodeBuilder)) {
                    pop();
                }
            }

            buffer.setLength(0);
        }