/** * parse a String and convert it into a java.lang.Object * * @param str the string to parse * @return the java.lang.Object represented by the string * @throws ParseException a parse exception is thrown if the string to parse does not follow the * rigth format (see the description of this class) */ public static Object parse(String str) throws ParseException { return parseYear(str); }
/** * parse a String and convert it into a java.lang.Object * @param str the string to parse * @return the java.lang.Object represented by the string * @throws ParseException a parse exception is thrown if the string to parse * does not follow the rigth format (see the description * of this class) */ public static Object parse(String str) throws ParseException { return parseYear(str); }
/** * Sets the value of the field associated with this descriptor. * * @param target the object in which to set the value * @param value the value of the field */ public void setValue(Object target, Object value) throws java.lang.IllegalStateException { if (!(target instanceof Year)) { // -- throw exception } Year yearTarget = (Year) target; if (value == null) { /// do something } // -- update current instance of time with new year try { Year temp = Year.parseYear(value.toString()); yearTarget.setCentury(temp.getCentury()); yearTarget.setYear(temp.getYear()); } catch (Exception ex) { // -- ignore for now } } // -- setValue
/** * Sets the value of the field associated with this descriptor. * * @param target * the object in which to set the value * @param value * the value of the field */ public void setValue(Object target, Object value) throws java.lang.IllegalStateException { if (! (target instanceof Year) ) { //-- throw exception } Year yearTarget = (Year) target; if (value == null) { /// do something } //-- update current instance of time with new year try { Year temp = Year.parseYear(value.toString()) ; yearTarget.setCentury(temp.getCentury()); yearTarget.setYear(temp.getYear()); } catch (Exception ex) { //-- ignore for now } } //-- setValue