Search in sources :

Example 1 with DSLMappingParseException

use of org.drools.compiler.lang.dsl.DSLMappingParseException 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;
}
Also used : DSLMappingParseException(org.drools.compiler.lang.dsl.DSLMappingParseException) ValidationMessage(org.guvnor.common.services.shared.validation.model.ValidationMessage) ArrayList(java.util.ArrayList) DSLMappingParseException(org.drools.compiler.lang.dsl.DSLMappingParseException) IOException(java.io.IOException) FileAlreadyExistsException(org.uberfire.java.nio.file.FileAlreadyExistsException)

Aggregations

IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 DSLMappingParseException (org.drools.compiler.lang.dsl.DSLMappingParseException)1 ValidationMessage (org.guvnor.common.services.shared.validation.model.ValidationMessage)1 FileAlreadyExistsException (org.uberfire.java.nio.file.FileAlreadyExistsException)1