Example usage for org.apache.wicket.util.convert ConversionException getVariables

List of usage examples for org.apache.wicket.util.convert ConversionException getVariables

Introduction

In this page you can find the example usage for org.apache.wicket.util.convert ConversionException getVariables.

Prototype

public Map<String, Object> getVariables() 

Source Link

Document

Returns the map of variables for this exception.

Usage

From source file:org.wicketstuff.multitextinput.MultiTextInput.java

License:Apache License

/**
 * Robbed from {@link FormComponent}//from   www  .java 2  s.  com
 * 
 * @param e
 * @param error
 */
private void reportValidationError(ConversionException e, ValidationError error) {
    final Locale locale = e.getLocale();
    if (locale != null) {
        error.setVariable("locale", locale);
    }
    error.setVariable("exception", e);
    Format format = e.getFormat();
    if (format instanceof SimpleDateFormat) {
        error.setVariable("format", ((SimpleDateFormat) format).toLocalizedPattern());
    }

    Map<String, Object> variables = e.getVariables();
    if (variables != null) {
        error.getVariables().putAll(variables);
    }

    error(error);
}