AstLiteral header = take(environment, elements, ELEMENT_HAS_HEADER_NAME, LiteralKind.BOOLEAN);
AstLiteral linefeed = take(environment, elements, ELEMENT_ALLOW_LINEFEED, LiteralKind.BOOLEAN);
AstLiteral codec = take(environment, elements, ELEMENT_CODEC_NAME, LiteralKind.STRING);
environment.reportAll(AttributeUtil.reportInvalidElements(attribute, elements.values()));
Configuration result = new Configuration();
if (charset != null && checkNotEmpty(environment, ELEMENT_CHARSET_NAME, charset)) {
result.setCharsetName(charset.toStringValue());
}
if (header != null) {
result.setEnableHeader(header.toBooleanValue());
}
if (linefeed != null) {
result.setAllowLinefeed(linefeed.toBooleanValue());
}
if (codec != null && checkNotEmpty(environment, ELEMENT_CODEC_NAME, codec)) {
result.setCodecName(codec.toStringValue());
}
return result;
}