protected void validateFeature(String name, MailAdapter mail,
SieveContext context) throws FeatureException {
if (name.startsWith(COMPARATOR_PREFIX)) {
final String comparatorName = name.substring(COMPARATOR_PREFIX_LENGTH);
if (!context.getComparatorManager().isSupported(comparatorName)) {
throw new FeatureException("Comparator \"" + comparatorName
+ "\" is not supported.");
}
} else {
// Validate as a Command
try {
validateCommand(name, context);
return;
} catch (LookupException e) {
// Not a command
}
// Validate as a Test
try {
validateTest(name, context);
} catch (LookupException e) {
throw new FeatureException("Feature \"" + name
+ "\" is not supported.");
}
}
}