better rendering of slicing logic

This commit is contained in:
Grahame Grieve 2020-01-30 11:05:54 +11:00
parent 408ceb1761
commit c7f3a47ec9
2 changed files with 10 additions and 7 deletions

View File

@ -487,6 +487,7 @@ public class ValidationMessage implements Comparator<ValidationMessage>, Compara
private String html;
private String locationLink;
private String txLink;
public String sliceHtml;
private boolean slicingHint;
@ -756,5 +757,13 @@ public class ValidationMessage implements Comparator<ValidationMessage>, Compara
return this;
}
public String getSliceHtml() {
return sliceHtml;
}
public void setSliceHtml(String sliceHtml) {
this.sliceHtml = sliceHtml;
}
}

View File

@ -157,16 +157,10 @@ public class BaseValidator {
* Set this parameter to <code>false</code> if the validation does not pass
* @return Returns <code>thePass</code> (in other words, returns <code>true</code> if the rule did not fail validation)
*/
protected boolean slicingHint(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String msg) {
if (!thePass) {
addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.INFORMATION).setSlicingHint(true);
}
return thePass;
}
protected boolean slicingHint(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String msg, String html) {
if (!thePass) {
addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.INFORMATION).setSlicingHint(true).setHtml(html);
addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.INFORMATION).setSlicingHint(true).setSliceHtml(html);
}
return thePass;
}