コード例 #1
0
  public static Serializable getAttributeFromStringArray(int type, String[] attribute) {

    if (ArrayUtil.isEmpty(attribute)) {
      return null;
    }

    if (type == ExpandoColumnConstants.BOOLEAN) {
      return GetterUtil.getBoolean(attribute[0]);
    } else if (type == ExpandoColumnConstants.BOOLEAN_ARRAY) {
      return GetterUtil.getBooleanValues(attribute);
    } else if (type == ExpandoColumnConstants.DATE) {
      return GetterUtil.getDate(attribute[0], _getDateFormat());
    } else if (type == ExpandoColumnConstants.DATE_ARRAY) {
      return GetterUtil.getDateValues(attribute, _getDateFormat());
    } else if (type == ExpandoColumnConstants.DOUBLE) {
      return GetterUtil.getDouble(attribute[0]);
    } else if (type == ExpandoColumnConstants.DOUBLE_ARRAY) {
      return GetterUtil.getDoubleValues(attribute);
    } else if (type == ExpandoColumnConstants.FLOAT) {
      return GetterUtil.getFloat(attribute[0]);
    } else if (type == ExpandoColumnConstants.FLOAT_ARRAY) {
      return GetterUtil.getFloatValues(attribute);
    } else if (type == ExpandoColumnConstants.INTEGER) {
      return GetterUtil.getInteger(attribute[0]);
    } else if (type == ExpandoColumnConstants.INTEGER_ARRAY) {
      return GetterUtil.getIntegerValues(attribute);
    } else if (type == ExpandoColumnConstants.LONG) {
      return GetterUtil.getLong(attribute[0]);
    } else if (type == ExpandoColumnConstants.LONG_ARRAY) {
      return GetterUtil.getLongValues(attribute);
    } else if (type == ExpandoColumnConstants.SHORT) {
      return GetterUtil.getShort(attribute[0]);
    } else if (type == ExpandoColumnConstants.SHORT_ARRAY) {
      return GetterUtil.getShortValues(attribute);
    } else if (type == ExpandoColumnConstants.STRING) {
      return attribute[0];
    } else {
      return attribute;
    }
  }
コード例 #2
0
ファイル: ReleaseInfo.java プロジェクト: nitro1010/liferay
  public static final Date getBuildDate() {
    DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);

    return GetterUtil.getDate(date, df);
  }
コード例 #3
0
  public static Date getDate(ServiceContext serviceContext, String param, DateFormat dateFormat) {

    return GetterUtil.getDate(serviceContext.getAttribute(param), dateFormat);
  }
コード例 #4
0
  public static Date getDate(PortletRequest portletRequest, String param, DateFormat dateFormat) {

    return GetterUtil.getDate(portletRequest.getParameter(param), dateFormat);
  }
コード例 #5
0
  public static Date getDate(HttpServletRequest request, String param, DateFormat dateFormat) {

    return GetterUtil.getDate(request.getParameter(param), dateFormat);
  }