private void handleChildrenElements()

in log4j-converter-config/src/main/java/org/apache/logging/converter/config/internal/v1/AbstractComponentParser.java [124:154]


    private void handleChildrenElements(
            Node element,
            Log4j1ParserContext context,
            Map<String, ? extends MethodHandle> attributeMap,
            T componentBuilder)
            throws ConfigurationConverterException {
        // Counts children by tag name for error handling purposes
        XmlUtils.forEachChild(element, (Consumer<? super Element>) childElement -> {
            String nodeName = childElement.getNodeName();
            if (nodeName.equals(PARAM_TAG)) {
                // Handle attributes
                String name = childElement.getAttribute(NAME_ATTR);
                MethodHandle attributeSetter = attributeMap.get(name);
                if (attributeSetter == null) {
                    attributeSetter = attributeMap.get(StringUtils.capitalize(name));
                }
                if (attributeSetter != null) {
                    String value = childElement.getAttribute(VALUE_ATTR);
                    if (value.isEmpty()) {
                        throw new ConfigurationConverterException("No value specified for attribute " + name);
                    }
                    invokeAttributeSetter(componentBuilder, attributeSetter, name, value);
                } else {
                    throw new ConfigurationConverterException("Unsupported configuration attribute " + name
                            + " at path " + XmlUtils.getXPathExpression(childElement) + ".");
                }
            } else {
                handleUnknownElement(childElement, context, componentBuilder);
            }
        });
    }