public static ResultSeverityEnum fromCode(String theCode) { if (ourValues == null) { HashMap<String, ResultSeverityEnum> values = new HashMap<String, ResultSeverityEnum>(); for (ResultSeverityEnum next : values()) { values.put(next.getCode(), next); } ourValues = Collections.unmodifiableMap(values); } return ourValues.get(theCode); }
@Override public String toString() { ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); if (myLocationCol != null || myLocationLine != null) { b.append("col", myLocationCol); b.append("row", myLocationLine); } if (myLocationString != null) { b.append("locationString", myLocationString); } b.append("message", myMessage); if (mySeverity != null) { b.append("severity", mySeverity.getCode()); } return b.toString(); }
/** * 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 toString() { ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); if (myLocationCol != null || myLocationLine != null) { b.append("col", myLocationCol); b.append("row", myLocationLine); } if (myLocationString != null) { b.append("locationString", myLocationString); } b.append("message", myMessage); if (mySeverity != null) { b.append("severity", mySeverity.getCode()); } return b.toString(); }
public static ResultSeverityEnum fromCode(String theCode) { if (ourValues == null) { HashMap<String, ResultSeverityEnum> values = new HashMap<String, ResultSeverityEnum>(); for (ResultSeverityEnum next : values()) { values.put(next.getCode(), next); } ourValues = Collections.unmodifiableMap(values); } return ourValues.get(theCode); }
/** * 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"); } }