下面列出了java.text.ParseException#toString ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public CalendarParsedResult(String summary,
String startString,
String endString,
String location,
String organizer,
String[] attendees,
String description,
double latitude,
double longitude) {
super(ParsedResultType.CALENDAR);
this.summary = summary;
try {
this.start = parseDate(startString);
this.end = endString == null ? null : parseDate(endString);
} catch (ParseException pe) {
throw new IllegalArgumentException(pe.toString());
}
this.startAllDay = startString.length() == 8;
this.endAllDay = endString != null && endString.length() == 8;
this.location = location;
this.organizer = organizer;
this.attendees = attendees;
this.description = description;
this.latitude = latitude;
this.longitude = longitude;
}
public Calendar bind(String name, Annotation[] annotations, String value, Class actualClass, Type genericType) throws Exception {
if (value == null || value.trim().length() == 0) {
return null;
}
Calendar cal = Calendar.getInstance(Lang.getLocale());
try {
Date date = AnnotationHelper.getDateAs(annotations, value);
if (date != null) {
cal.setTime(date);
} else {
SimpleDateFormat sdf = new SimpleDateFormat(I18N.getDateFormat());
sdf.setLenient(false);
cal.setTime(sdf.parse(value));
}
} catch (ParseException e) {
throw new IllegalArgumentException("Cannot convert [" + value + "] to a Calendar: " + e.toString());
}
return cal;
}
public Date getDate(ResultSet paramResultSet, int paramInt) throws SQLException {
try {
return super.getDate(paramResultSet, paramInt);
} catch (StringIndexOutOfBoundsException localStringIndexOutOfBoundsException) {
String str = paramResultSet.getString(paramInt);
SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SS");
try {
return localSimpleDateFormat.parse(str);
} catch (ParseException localParseException) {
throw new SQLException(localParseException.toString());
}
}
}