Search in sources :

Example 1 with ValidationResults

use of org.eclipse.wst.validation.ValidationResults in project liferay-ide by liferay.

the class KaleoUtil method checkWorkflowDefinitionForErrors.

public static String checkWorkflowDefinitionForErrors(IFile workspaceFile) {
    String retval = null;
    try {
        StringBuilder errorMsgs = new StringBuilder();
        ValOperation result = ValidationRunner.validate(workspaceFile, ValType.Manual, null, true);
        ValidationResultSummary validationResult = result.getResult();
        if (validationResult.getSeverityError() == 1) {
            ValidationResults results = result.getResults();
            for (ValidatorMessage message : results.getMessages()) {
                if (message.getAttribute(IMarker.SEVERITY, -1) == IMarker.SEVERITY_ERROR) {
                    errorMsgs.append(message.getAttribute(IMarker.MESSAGE)).append('\n');
                }
            }
        }
        retval = errorMsgs.toString();
    } catch (Exception e) {
    }
    return retval;
}
Also used : ValidationResultSummary(org.eclipse.wst.validation.internal.ValidationResultSummary) ValidationResults(org.eclipse.wst.validation.ValidationResults) ValOperation(org.eclipse.wst.validation.internal.ValOperation) ValidatorMessage(org.eclipse.wst.validation.ValidatorMessage) JSONException(org.json.JSONException) SAXParseException(org.xml.sax.SAXParseException) SAXException(org.xml.sax.SAXException)

Aggregations

ValidationResults (org.eclipse.wst.validation.ValidationResults)1 ValidatorMessage (org.eclipse.wst.validation.ValidatorMessage)1 ValOperation (org.eclipse.wst.validation.internal.ValOperation)1 ValidationResultSummary (org.eclipse.wst.validation.internal.ValidationResultSummary)1 JSONException (org.json.JSONException)1 SAXException (org.xml.sax.SAXException)1 SAXParseException (org.xml.sax.SAXParseException)1