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

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

Introduction

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

Prototype

public final ConversionException setTargetType(final Class<?> targetType) 

Source Link

Document

Sets the target property type.

Usage

From source file:org.artifactory.common.wicket.component.checkbox.styled.StyledCheckbox.java

License:Open Source License

private static Boolean toBoolean(String[] value) throws ConversionException {
    String tmp = value != null && value.length > 0 ? value[0] : null;
    try {//from w  w w . jav a2  s  .com
        return Strings.toBoolean(tmp);
    } catch (StringValueConversionException e) {
        final ConversionException conversionException = new ConversionException(
                String.format("Invalid boolean input value posted \"%s\"", tmp), e);
        conversionException.setTargetType(Boolean.class);
        throw conversionException;
    }
}