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

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

Introduction

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

Prototype

public final Locale getLocale() 

Source Link

Document

Get the used locale.

Usage

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

License:Apache License

/**
 * Robbed from {@link FormComponent}/*from   w ww  .j  a  v a2s .co m*/
 * 
 * @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);
}