@Override public String lookup(String theKey) { if ("line".equals(theKey)) { return toString(myMessage.getLocationLine()); } if ("col".equals(theKey)) { return toString(myMessage.getLocationCol()); } if ("message".equals(theKey)) { return toString(myMessage.getMessage()); } if ("location".equals(theKey)) { return toString(myMessage.getLocationString()); } if ("severity".equals(theKey)) { return myMessage.getSeverity() != null ? myMessage.getSeverity().name() : null; } return ""; }
/** * Populate an operation outcome with the results of the validation */ public void populateOperationOutcome(IBaseOperationOutcome theOperationOutcome) { for (SingleValidationMessage next : myMessages) { String location; if (isNotBlank(next.getLocationString())) { location = next.getLocationString(); } else if (next.getLocationLine() != null || next.getLocationCol() != null) { location = "Line[" + next.getLocationLine() + "] Col[" + next.getLocationCol() + "]"; } else { location = null; } String severity = next.getSeverity() != null ? next.getSeverity().getCode() : null; OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, severity, next.getMessage(), location, Constants.OO_INFOSTATUS_PROCESSING); } if (myMessages.isEmpty()) { String message = myCtx.getLocalizer().getMessage(ValidationResult.class, "noIssuesDetected"); OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, "information", message, null, "informational"); } }
@Override public String lookup(String theKey) { if ("line".equals(theKey)) { return toString(myMessage.getLocationLine()); } if ("col".equals(theKey)) { return toString(myMessage.getLocationCol()); } if ("message".equals(theKey)) { return toString(myMessage.getMessage()); } if ("location".equals(theKey)) { return toString(myMessage.getLocationString()); } if ("severity".equals(theKey)) { return myMessage.getSeverity() != null ? myMessage.getSeverity().name() : null; } return ""; }
/** * Populate an operation outcome with the results of the validation */ public void populateOperationOutcome(IBaseOperationOutcome theOperationOutcome) { for (SingleValidationMessage next : myMessages) { String location; if (isNotBlank(next.getLocationString())) { location = next.getLocationString(); } else if (next.getLocationLine() != null || next.getLocationCol() != null) { location = "Line[" + next.getLocationLine() + "] Col[" + next.getLocationCol() + "]"; } else { location = null; } String severity = next.getSeverity() != null ? next.getSeverity().getCode() : null; OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, severity, next.getMessage(), location, Constants.OO_INFOSTATUS_PROCESSING); } if (myMessages.isEmpty()) { String message = myCtx.getLocalizer().getMessage(ValidationResult.class, "noIssuesDetected"); OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, "information", message, null, "informational"); } }