private void addResponseIssueHeader(RequestDetails theRequestDetails, SingleValidationMessage theNext) { // Perform any string substitutions from the message format StrLookup<?> lookup = new MyLookup(theNext); StrSubstitutor subs = new StrSubstitutor(lookup, "${", "}", '\\'); // Log the header String headerValue = subs.replace(myResponseIssueHeaderValue); ourLog.trace("Adding header to response: {}", headerValue); theRequestDetails.getResponse().addHeader(myResponseIssueHeaderName, headerValue); }
@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 ""; }
@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 ""; }
private void addResponseIssueHeader(RequestDetails theRequestDetails, SingleValidationMessage theNext) { // Perform any string substitutions from the message format StrLookup<?> lookup = new MyLookup(theNext); StrSubstitutor subs = new StrSubstitutor(lookup, "${", "}", '\\'); // Log the header String headerValue = subs.replace(myResponseIssueHeaderValue); ourLog.trace("Adding header to response: {}", headerValue); theRequestDetails.getResponse().addHeader(myResponseIssueHeaderName, headerValue); }