private static void mapSingleAttributeDefinition(final String attributeName, final String mappedAttributeName,
final Object attributeValue, final Map<String, Object> resolvedAttributes,
final Map<String, Object> attributesToRelease) {
val matcherInline = ScriptingUtils.getMatcherForInlineGroovyScript(mappedAttributeName);
val matcherFile = ScriptingUtils.getMatcherForExternalGroovyScript(mappedAttributeName);
if (matcherInline.find()) {
LOGGER.debug("Mapped attribute [{}] is an inlined groovy script", mappedAttributeName);
processInlineGroovyAttribute(resolvedAttributes, attributesToRelease, matcherInline, attributeName);
} else if (matcherFile.find()) {
LOGGER.debug("Mapped attribute [{}] is an external groovy script", mappedAttributeName);
processFileBasedGroovyAttributes(resolvedAttributes, attributesToRelease, matcherFile, attributeName);
} else {
if (attributeValue != null) {
LOGGER.debug("Found attribute [{}] in the list of allowed attributes, mapped to the name [{}]",
attributeName, mappedAttributeName);
attributesToRelease.put(mappedAttributeName, attributeValue);
} else {
LOGGER.warn("Could not find value for mapped attribute [{}] that is based off of [{}] in the allowed attributes list. "
+ "Ensure the original attribute [{}] is retrieved and contains at least a single value. Attribute [{}] "
+ "will and can not be released without the presence of a value.", mappedAttributeName, attributeName,
attributeName, mappedAttributeName);
}
}
}