public java.util.Date getDate(java.lang.String value, java.text.DateFormat dateFormat) { return GetterUtil.getDate(value, dateFormat); }
public java.util.Date getDate(java.lang.String value, java.text.DateFormat dateFormat, java.util.Date defaultValue) { return GetterUtil.getDate(value, dateFormat, defaultValue); }
public java.util.Date getDate(java.lang.Object value, java.text.DateFormat dateFormat) { return GetterUtil.getDate(value, dateFormat); }
public java.util.Date getDate(java.lang.Object value, java.text.DateFormat dateFormat, java.util.Date defaultValue) { return GetterUtil.getDate(value, dateFormat, defaultValue); }
/** * Returns the Object value as a Date. If the value is <code>null</code> or * not convertible to a Date, the current date is returned. * * @param value the value to convert * @param dateFormat the format used to parse the date * @return the value as a Date */ public static Date getDate(Object value, DateFormat dateFormat) { return getDate(value, dateFormat, new Date()); }
/** * Returns the String value as a Date. If the value is <code>null</code> or * not convertible to a Date, the current date is returned. * * @param value the value to convert * @param dateFormat the format used to parse the date * @return the value as a Date */ public static Date getDate(String value, DateFormat dateFormat) { return getDate(value, dateFormat, new Date()); }
/** * Returns the String value as a Date array. If the values array is * <code>null</code>, the default value is returned. In the returned array, * each value element not convertible to a Date is replaced by the current * date. * * @param values the values to convert * @param dateFormat the format used to parse the date * @param defaultValue a default value * @return the values as a Date array */ public static Date[] getDateValues( String[] values, DateFormat dateFormat, Date[] defaultValue) { if (values == null) { return defaultValue; } Date[] dateValues = new Date[values.length]; for (int i = 0; i < values.length; i++) { dateValues[i] = getDate(values[i], dateFormat); } return dateValues; }
/** * Returns the request parameter value as a Date. If the parameter is * missing or not convertible to a Date, the current date is returned. * * @param request the servlet request from which to read the parameter * @param param the name of the parameter * @param dateFormat the format used to parse the date * @return the request parameter value as a Date */ public static Date getDate( HttpServletRequest request, String param, DateFormat dateFormat) { return GetterUtil.getDate(request.getParameter(param), dateFormat); }
public static final Date getBuildDate() { DateFormat df = DateFormat.getDateInstance(DateFormat.LONG); return GetterUtil.getDate(_DATE, df); }
/** * Returns the portlet request parameter value as a Date. If the parameter * is missing or not convertible to a Date, the current date is returned. * * @param portletRequest the portlet request from which to read the * parameter * @param param the name of the parameter * @param dateFormat the format used to parse the date * @return the portlet request parameter value as a Date */ public static Date getDate( PortletRequest portletRequest, String param, DateFormat dateFormat) { return GetterUtil.getDate( portletRequest.getParameter(param), dateFormat); }
/** * Returns the service context parameter value as a Date. If the parameter * is missing or not convertible to a Date, the current date is returned. * * @param serviceContext the service context from which to read the * parameter * @param param the name of the parameter * @param dateFormat the format used to parse the date * @return the service context parameter value as a Date */ public static Date getDate( ServiceContext serviceContext, String param, DateFormat dateFormat) { return GetterUtil.getDate( serviceContext.getAttribute(param), dateFormat); }
private static Date _getDate(String dateString) { if (Validator.isNumber(dateString)) { return new Date(GetterUtil.getLong(dateString)); } return GetterUtil.getDate(dateString, _getDateFormat()); }
public java.util.Date getDate(java.lang.String value, java.text.DateFormat df) { return GetterUtil.getDate(value, df); }
public java.util.Date getDate(java.lang.String value, java.text.DateFormat df, java.util.Date defaultValue) { return GetterUtil.getDate(value, df, defaultValue); }
public static final Date getBuildDate() { DateFormat df = DateFormat.getDateInstance(DateFormat.LONG); return GetterUtil.getDate(date, df); }
public static Date getDate(String value, DateFormat df) { return getDate(value, df, new Date()); }
public static Date getDate( HttpServletRequest request, String param, DateFormat df, Date defaultValue) { return get(request, param, df, defaultValue); }
public AuditMessage(String message) throws JSONException { JSONObject jsonObject = JSONFactoryUtil.createJSONObject(message); _additionalInfoJSONObject = jsonObject.getJSONObject(_ADDITIONAL_INFO); _className = jsonObject.getString(_CLASS_NAME); _classPK = jsonObject.getString(_CLASS_PK); if (jsonObject.has(_CLIENT_HOST)) { _clientHost = jsonObject.getString(_CLIENT_HOST); } if (jsonObject.has(_CLIENT_IP)) { _clientIP = jsonObject.getString(_CLIENT_IP); } _companyId = jsonObject.getLong(_COMPANY_ID); _eventType = jsonObject.getString(_EVENT_TYPE); _message = jsonObject.getString(_MESSAGE); if (jsonObject.has(_SERVER_NAME)) { _serverName = jsonObject.getString(_SERVER_NAME); } if (jsonObject.has(_SERVER_PORT)) { _serverPort = jsonObject.getInt(_SERVER_PORT); } if (jsonObject.has(_SESSION_ID)) { _sessionID = jsonObject.getString(_SESSION_ID); } _timestamp = GetterUtil.getDate( jsonObject.getString(_TIMESTAMP), _getDateFormat()); _userId = jsonObject.getLong(_USER_ID); _userName = jsonObject.getString(_USER_NAME); }
public static Date getDate( PortletRequest portletRequest, String param, DateFormat df, Date defaultValue) { return get(portletRequest, param, df, defaultValue); }
String exportDateString = element.attributeValue("export-date"); Date exportDate = GetterUtil.getDate( exportDateString, DateFormatFactoryUtil.getSimpleDateFormat(