PropertyOracle propertyOracle = context.getPropertyOracle();
String severityText;
try {
ConfigurationProperty property = propertyOracle.getConfigurationProperty(DocumentModeAsserter.PROPERTY_DOCUMENT_COMPATMODE_SEVERITY);
severityText = property.getValues().get(0);
} catch (BadPropertyValueException e) {
logger.log(TreeLogger.ERROR, "Unable to find value for '"
+ DocumentModeAsserter.PROPERTY_DOCUMENT_COMPATMODE_SEVERITY + "'", e);
throw new UnableToCompleteException();
}
Severity severity;
try {
severity = Severity.valueOf(severityText);
} catch (IllegalArgumentException e) {
logger.log(TreeLogger.ERROR, "Value '" + severityText + "' for '"
+ DocumentModeAsserter.PROPERTY_DOCUMENT_COMPATMODE_SEVERITY + "' is not one of: "
+ Arrays.toString(Severity.values()), e);
throw new UnableToCompleteException();
}
List<String> documentModes;
try {
ConfigurationProperty property = propertyOracle.getConfigurationProperty(DocumentModeAsserter.PROPERTY_DOCUMENT_COMPATMODE);
documentModes = property.getValues();
} catch (BadPropertyValueException e) {
logger.log(TreeLogger.ERROR, "Unable to find value for '"
+ DocumentModeAsserter.PROPERTY_DOCUMENT_COMPATMODE + "'", e);
throw new UnableToCompleteException();
}