in src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java [451:502]
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 {
if ("string".equals(qName)) {
peekNE().addValue(buffer.toString());
} else if ("integer".equals(qName)) {
peekNE().addIntegerValue(buffer.toString());
} else if ("real".equals(qName)) {
peekNE().addRealValue(buffer.toString());
} else if ("true".equals(qName)) {
peekNE().addTrueValue();
} else if ("false".equals(qName)) {
peekNE().addFalseValue();
} else if ("data".equals(qName)) {
peekNE().addDataValue(buffer.toString());
} else if ("date".equals(qName)) {
try {
peekNE().addDateValue(buffer.toString());
} catch (final IllegalArgumentException iex) {
getLogger().warn("Ignoring invalid date property " + buffer);
}
} else if ("array".equals(qName)) {
final ArrayNodeBuilder array = (ArrayNodeBuilder) pop();
peekNE().addList(array);
}
// 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);
}