calendar = Calendar.getInstance();
} else {
try {
calendar = (Calendar) clazz.newInstance();
} catch (Exception e) {
throw new JSONException("can not cast to : " + clazz.getName(), e);
}
}
calendar.setTime(date);
return (T) calendar;
}
if (obj instanceof String) {
String strVal = (String) obj;
if (strVal.length() == 0) {
return null;
}
}
throw new JSONException("can not cast to : " + clazz.getName());
}