use of org.springframework.binding.message.MessageResolver in project head by mifos.
the class QuestionnaireController method constructErrorMessage.
protected void constructErrorMessage(String code, String message, MessageContext context, Object... args) {
MessageResolver messageResolver = new MessageBuilder().error().code(code).defaultText(message).args(args).build();
context.addMessage(messageResolver);
}
use of org.springframework.binding.message.MessageResolver in project head by mifos.
the class CashFlowValidator method constructErrorMessage.
void constructErrorMessage(String code, String message, MessageContext context, Object... args) {
MessageResolver messageResolver = new MessageBuilder().error().code(code).defaultText(message).args(args).build();
context.addMessage(messageResolver);
}
use of org.springframework.binding.message.MessageResolver in project uPortal by Jasig.
the class PersonQueryValidator method validatePersonLookup.
/** Ensures all passed attributes are part of the valid query attribute set. */
public void validatePersonLookup(PersonQuery personQuery, MessageContext context) {
final RequestContext requestContext = RequestContextHolder.getRequestContext();
final ExternalContext externalContext = requestContext.getExternalContext();
final Set<String> queryAttributes = personLookupHelper.getQueryAttributes(externalContext);
final Map<String, Attribute> attributes = personQuery.getAttributes();
for (final String attribute : attributes.keySet()) {
if (!queryAttributes.contains(attribute)) {
final MessageBuilder messageBuilder = new MessageBuilder();
messageBuilder.error();
messageBuilder.source("attributes[" + attribute + "].value");
messageBuilder.code("personLookup.invalidQueryAttribute");
messageBuilder.arg(attribute);
final MessageResolver errorMessage = messageBuilder.build();
context.addMessage(errorMessage);
}
}
}
use of org.springframework.binding.message.MessageResolver in project head by mifos.
the class ValidationExceptionMessageExtractor method constructErrorMessage.
private void constructErrorMessage(String code, String defaultMessage, MessageContext context, Object... args) {
MessageResolver messageResolver = new MessageBuilder().error().code(code).defaultText(defaultMessage).args(args).build();
context.addMessage(messageResolver);
}
use of org.springframework.binding.message.MessageResolver in project head by mifos.
the class QuestionnaireController method constructErrorMessage.
protected void constructErrorMessage(MessageContext context, String code, String source, String message) {
MessageResolver messageResolver = new MessageBuilder().error().code(code).source(source).defaultText(message).build();
context.addMessage(messageResolver);
}
Aggregations