use of org.guvnor.common.services.shared.validation.model.ValidationMessage in project drools-wb by kiegroup.
the class EnumServiceImpl method makeValidationMessages.
private ValidationMessage makeValidationMessages(final Path path, final String message) {
final ValidationMessage msg = new ValidationMessage();
msg.setPath(path);
msg.setLevel(Level.ERROR);
msg.setText(message);
return msg;
}
use of org.guvnor.common.services.shared.validation.model.ValidationMessage in project drools-wb by kiegroup.
the class DSLTextEditorServiceImpl method makeNewValidationMessage.
private ValidationMessage makeNewValidationMessage(final Exception e) {
final ValidationMessage msg = new ValidationMessage();
msg.setLevel(Level.ERROR);
msg.setText("Exception " + e.getClass() + " " + e.getMessage() + " " + e.getCause());
return msg;
}
use of org.guvnor.common.services.shared.validation.model.ValidationMessage in project drools-wb by kiegroup.
the class DSLTextEditorServiceImpl method makeNewValidationMessage.
private ValidationMessage makeNewValidationMessage(final DSLMappingParseException e) {
final ValidationMessage msg = new ValidationMessage();
msg.setLevel(Level.ERROR);
msg.setLine(e.getLine());
msg.setText(e.getMessage());
return msg;
}
use of org.guvnor.common.services.shared.validation.model.ValidationMessage in project drools-wb by kiegroup.
the class DSLTextEditorServiceImpl method doValidation.
private List<ValidationMessage> doValidation(final String content) {
final List<ValidationMessage> validationMessages = new ArrayList<ValidationMessage>();
final DSLTokenizedMappingFile dslLoader = new DSLTokenizedMappingFile();
try {
if (!dslLoader.parseAndLoad(new StringReader(content))) {
validationMessages.addAll(makeValidationMessages(dslLoader));
}
return validationMessages;
} catch (IOException e) {
throw ExceptionUtilities.handleException(e);
}
}
use of org.guvnor.common.services.shared.validation.model.ValidationMessage in project drools-wb by kiegroup.
the class DSLTextEditorServiceImpl method makeValidationMessages.
private List<ValidationMessage> makeValidationMessages(final DSLTokenizedMappingFile dslLoader) {
final List<ValidationMessage> messages = new ArrayList<ValidationMessage>();
for (final Object o : dslLoader.getErrors()) {
if (o instanceof DSLMappingParseException) {
final DSLMappingParseException dslMappingParseException = (DSLMappingParseException) o;
messages.add(makeNewValidationMessage(dslMappingParseException));
} else if (o instanceof Exception) {
final Exception e = (Exception) o;
messages.add(makeNewValidationMessage(e));
} else {
messages.add(makeNewValidationMessage(o));
}
}
return messages;
}
Aggregations