private Date readOptionalDate ( JSONValue val ) { JSONString str = null == val ? null : val . isString ( ) ; if ( str != null ) { try { return new Date ( Long . parseLong ( str . stringValue ( ) ) ) ; } catch ( @ SuppressWarnings ( "unused" ) NumberFormatException e ) { // do nothing - return the default value } } return null ; }
Read an optional Date value form a JSON value .