public String dateToString ( D date ) { try { return String . format ( DATE_PATTERN , ( Integer ) PropertyUtils . getProperty ( date , "year" ) , ( Integer ) PropertyUtils . getProperty ( date , "month" ) , ( Integer ) PropertyUtils . getProperty ( date , "day" ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Could not access class." , e ) ; } catch ( InvocationTargetException e ) { throw new IllegalStateException ( "Could not get field." , e ) ; } catch ( NoSuchMethodException e ) { throw new IllegalStateException ( "Could not get field." , e ) ; } }
Returns string representation of this date .