ConfigurationValue value = findElementOrThrowException(expression);
return (T) ValueConverterRegistry.convert(clazz, clazz, value.value());
}
private ConfigurationValue resolveMatch(List<ConfigurationValue> values) {
ConfigurationValue bestMatch = null;
for (ConfigurationValue configurationNode : values) {
if (ConfigurationValue.DEFAULT_TAG.equals(configurationNode.tag())) {
if (bestMatch == null || bestMatch.tag().equals(ConfigurationValue.DEFAULT_TAG)) {
bestMatch = configurationNode;
}
} else if (currentTags.contains(configurationNode.tag())) {
if (bestMatch == null) {
bestMatch = configurationNode;
} else {
int previousFoundPriority =
ConfigurationValue.DEFAULT_TAG.equals(bestMatch.tag()) ?
Integer.MAX_VALUE : currentTags.indexOf(bestMatch.tag());
if (currentTags.indexOf(configurationNode.tag()) <= previousFoundPriority) {
bestMatch = configurationNode;
}
}
} else if (ConfigurationValue.ALL_TAG.equals(configurationNode.tag())) {