batch-jberet/src/main/java/org/wildfly/extension/batch/jberet/AttributeParsers.java
static Map<Attribute, String> readRequiredAttributes(final XMLExtendedStreamReader reader, final Set<Attribute> attributes) throws XMLStreamException {
        final int attributeCount = reader.getAttributeCount();
        final Map<Attribute, String> result = new EnumMap<>(Attribute.class);
        for (int i = 0; i < attributeCount; i++) {
            final Attribute current = Attribute.forName(reader.getAttributeLocalName(i));
            if (attributes.contains(current)) {
                if (result.put(current, reader.getAttributeValue(i)) != null) {
                    throw ParseUtils.duplicateAttribute(reader, current.getLocalName());
                }
            } else {
                throw ParseUtils.unexpectedAttribute(reader, i, attributes.stream().map(Attribute::getLocalName).collect(Collectors.toSet()));
            }
        }
        if (result.isEmpty()) {
            throw ParseUtils.missingRequired(reader, attributes.stream().map(Attribute::getLocalName).collect(Collectors.toSet()));
        }
        return result;
    }
static Map<Attribute, String> readRequiredAttributes(final XMLExtendedStreamReader reader, final Set<Attribute> attributes) throws XMLStreamException {
        final int attributeCount = reader.getAttributeCount();
        final Map<Attribute, String> result = new EnumMap<>(Attribute.class);
        for (int i = 0; i < attributeCount; i++) {
            final Attribute current = Attribute.forName(reader.getAttributeLocalName(i));
            if (attributes.contains(current)) {
                if (result.put(current, reader.getAttributeValue(i)) != null) {
                    throw ParseUtils.duplicateAttribute(reader, current.getLocalName());
                }
            } else {
                throw ParseUtils.unexpectedAttribute(reader, i, attributes.stream().map(Attribute::getLocalName).collect(Collectors.toSet()));
            }
        }
        if (result.isEmpty()) {
            throw ParseUtils.missingRequired(reader, attributes.stream().map(Attribute::getLocalName).collect(Collectors.toSet()));
        }
        return result;
    }
static Map < Attribute , String > readRequiredAttributes ( final XMLExtendedStreamReader reader , final Set < Attribute > attributes ) throws XMLStreamException { final int attributeCount = reader . getAttributeCount ( ) ; final Map < Attribute , String > result = new EnumMap <> ( Attribute . class ) ; for ( int i = 0 ; i < attributeCount ; i ++ ) { final Attribute current = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; if ( attributes . contains ( current ) ) { if ( result . put ( current , reader . getAttributeValue ( i ) ) != null ) { throw ParseUtils . duplicateAttribute ( reader , current . getLocalName ( ) ) ; } } else { throw ParseUtils . unexpectedAttribute ( reader , i , attributes . stream ( ) . map ( Attribute :: getLocalName ) . collect ( Collectors . toSet ( ) ) ) ; } } if ( result . isEmpty ( ) ) { throw ParseUtils . missingRequired ( reader , attributes . stream ( ) . map ( Attribute :: getLocalName ) . collect ( Collectors . toSet ( ) ) ) ; } return result ; }
Reads the required attributes from an XML configuration.
<p>
The reader must be on an element with attributes.
</p>

@param reader     the reader for the attributes
@param attributes the required attributes

@return a map of the required attributes with the key being the attribute and the value being the value of the
attribute

@throws XMLStreamException if an XML processing error occurs
Reads the required attributes from an XML configuration . <p > The reader must be on an element with attributes . < / p >