class ShortConverter implements PropertyConverter<Short> {

    @Override
    public Short convert(String value, ConversionContext ctx) {
        ctx.addSupportedFormats(getClass(), "short", "MIN", "MIN_VALUE", "MAX", "MAX_VALUE");
        if(value==null){
            return null;
        }
        String trimmed = value.trim();
        switch(trimmed.toUpperCase(Locale.ENGLISH)){
            case "MIN_VALUE":
            case "MIN":
                return Short.MIN_VALUE;
            case "MAX_VALUE":
            case "MAX":
                return Short.MAX_VALUE;
            default:
                try {
                    return Short.decode(trimmed);
                } catch(Exception e) {
                    LOG.finest("Unparseable Short: " + trimmed);
                    return null;
                }
        }
    }

}