/** * Returns the <code>Object</code> representation of the * <code>String</code> <code>text</code>, may be null. * * @param text <code>String</code> to convert * @return <code>Object</code> representation of text * @throws ParseException if there is an error in the conversion */ @Override public Object stringToValue(String text) throws ParseException { Object value = getParsedValue(text, getFormat()); try { if (!isValueInRange(value, true)) { throw new ParseException("Value not within min/max range", 0); } } catch (ClassCastException cce) { throw new ParseException("Class cast exception comparing values: " + cce, 0); } return convertValueToValueClass(value, getValueClass()); }
/** * */ @SuppressWarnings("unchecked") private void updateMinMax() { Comparable min = null; Comparable max = null; if (getValueClass() == Integer.class) { max = Integer.MAX_VALUE; min = Integer.MIN_VALUE; } else if (getValueClass() == Long.class) { max = Long.MAX_VALUE; min = Long.MIN_VALUE; } else if (getValueClass() == Short.class) { max = Short.MAX_VALUE; min = Short.MIN_VALUE; } else if (getValueClass() == Byte.class) { max = Byte.MAX_VALUE; min = Byte.MIN_VALUE; } else if (getValueClass() == Float.class) { max = Float.MAX_VALUE; min = Float.MIN_VALUE; } else if (getValueClass() == Double.class) { // don*t understand what's happening here, naive compare with bigDecimal // fails - so don't do anything for now // JW: revisit! } setMaximum(max); setMinimum(min); }
if ((getMinimum() == null) && getMaximum() == null) return true; Comparable<BigDecimal> min = getMinimumAsBig(); Comparable<BigDecimal> max = getMaximumAsBig(); try { if (max != null && max.compareTo(value) < 0) {
if ((getMinimum() == null) && getMaximum() == null) return true; Comparable<BigDecimal> min = getMinimumAsBig(); Comparable<BigDecimal> max = getMaximumAsBig(); try { if (max != null && max.compareTo(value) < 0) {
/** * Returns the <code>Object</code> representation of the * <code>String</code> <code>text</code>, may be null. * * @param text <code>String</code> to convert * @return <code>Object</code> representation of text * @throws ParseException if there is an error in the conversion */ @Override public Object stringToValue(String text) throws ParseException { Object value = getParsedValue(text, getFormat()); try { if (!isValueInRange(value, true)) { throw new ParseException("Value not within min/max range", 0); } } catch (ClassCastException cce) { throw new ParseException("Class cast exception comparing values: " + cce, 0); } return convertValueToValueClass(value, getValueClass()); }
if ((getMinimum() == null) && getMaximum() == null) return true; Comparable<BigDecimal> min = getMinimumAsBig(); Comparable<BigDecimal> max = getMaximumAsBig(); try { if (max != null && max.compareTo(value) < 0) {
/** * */ @SuppressWarnings("unchecked") private void updateMinMax() { Comparable min = null; Comparable max = null; if (getValueClass() == Integer.class) { max = Integer.MAX_VALUE; min = Integer.MIN_VALUE; } else if (getValueClass() == Long.class) { max = Long.MAX_VALUE; min = Long.MIN_VALUE; } else if (getValueClass() == Short.class) { max = Short.MAX_VALUE; min = Short.MIN_VALUE; } else if (getValueClass() == Byte.class) { max = Byte.MAX_VALUE; min = Byte.MIN_VALUE; } else if (getValueClass() == Float.class) { max = Float.MAX_VALUE; min = Float.MIN_VALUE; } else if (getValueClass() == Double.class) { // don*t understand what's happening here, naive compare with bigDecimal // fails - so don't do anything for now // JW: revisit! } setMaximum(max); setMinimum(min); }
/** * Returns the <code>Object</code> representation of the * <code>String</code> <code>text</code>, may be null. * * @param text <code>String</code> to convert * @return <code>Object</code> representation of text * @throws ParseException if there is an error in the conversion */ @Override public Object stringToValue(String text) throws ParseException { Object value = getParsedValue(text, getFormat()); try { if (!isValueInRange(value, true)) { throw new ParseException("Value not within min/max range", 0); } } catch (ClassCastException cce) { throw new ParseException("Class cast exception comparing values: " + cce, 0); } return convertValueToValueClass(value, getValueClass()); }
if ((getMinimum() == null) && getMaximum() == null) return true; Comparable<BigDecimal> min = getMinimumAsBig(); Comparable<BigDecimal> max = getMaximumAsBig(); try { if (max != null && max.compareTo(value) < 0) {
/** * */ @SuppressWarnings("unchecked") private void updateMinMax() { Comparable min = null; Comparable max = null; if (getValueClass() == Integer.class) { max = Integer.MAX_VALUE; min = Integer.MIN_VALUE; } else if (getValueClass() == Long.class) { max = Long.MAX_VALUE; min = Long.MIN_VALUE; } else if (getValueClass() == Short.class) { max = Short.MAX_VALUE; min = Short.MIN_VALUE; } else if (getValueClass() == Byte.class) { max = Byte.MAX_VALUE; min = Byte.MIN_VALUE; } else if (getValueClass() == Float.class) { max = Float.MAX_VALUE; min = Float.MIN_VALUE; } else if (getValueClass() == Double.class) { // don*t understand what's happening here, naive compare with bigDecimal // fails - so don't do anything for now // JW: revisit! } setMaximum(max); setMinimum(min); }
/** * Returns the <code>Object</code> representation of the * <code>String</code> <code>text</code>, may be null. * * @param text <code>String</code> to convert * @return <code>Object</code> representation of text * @throws ParseException if there is an error in the conversion */ @Override public Object stringToValue(String text) throws ParseException { Object value = getParsedValue(text, getFormat()); try { if (!isValueInRange(value, true)) { throw new ParseException("Value not within min/max range", 0); } } catch (ClassCastException cce) { throw new ParseException("Class cast exception comparing values: " + cce, 0); } return convertValueToValueClass(value, getValueClass()); }
/** * */ @SuppressWarnings("unchecked") private void updateMinMax() { Comparable min = null; Comparable max = null; if (getValueClass() == Integer.class) { max = Integer.MAX_VALUE; min = Integer.MIN_VALUE; } else if (getValueClass() == Long.class) { max = Long.MAX_VALUE; min = Long.MIN_VALUE; } else if (getValueClass() == Short.class) { max = Short.MAX_VALUE; min = Short.MIN_VALUE; } else if (getValueClass() == Byte.class) { max = Byte.MAX_VALUE; min = Byte.MIN_VALUE; } else if (getValueClass() == Float.class) { max = Float.MAX_VALUE; min = Float.MIN_VALUE; } else if (getValueClass() == Double.class) { // don*t understand what's happening here, naive compare with bigDecimal // fails - so don't do anything for now // JW: revisit! } setMaximum(max); setMinimum(min); }