/** * 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()); }
/** * 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()); }
/** * 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()); }
/** * 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()); }