Example usage for com.liferay.portal.kernel.util GetterUtil getDateValues

List of usage examples for com.liferay.portal.kernel.util GetterUtil getDateValues

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util GetterUtil getDateValues.

Prototype

public static Date[] getDateValues(String[] values, DateFormat dateFormat) 

Source Link

Document

Returns the String value as a Date array.

Usage

From source file:com.liferay.portlet.expando.util.ExpandoConverterUtil.java

License:Open Source License

public static Serializable getAttributeFromString(int type, String attribute) {

    if (attribute == null) {
        return null;
    }//from w  ww  .  j  ava 2s.c o m

    if (type == ExpandoColumnConstants.BOOLEAN) {
        return GetterUtil.getBoolean(attribute);
    } else if (type == ExpandoColumnConstants.BOOLEAN_ARRAY) {
        return GetterUtil.getBooleanValues(StringUtil.split(attribute));
    } else if (type == ExpandoColumnConstants.DATE) {
        return GetterUtil.getDate(attribute, _getDateFormat());
    } else if (type == ExpandoColumnConstants.DATE_ARRAY) {
        return GetterUtil.getDateValues(StringUtil.split(attribute), _getDateFormat());
    } else if (type == ExpandoColumnConstants.DOUBLE) {
        return GetterUtil.getDouble(attribute);
    } else if (type == ExpandoColumnConstants.DOUBLE_ARRAY) {
        return GetterUtil.getDoubleValues(StringUtil.split(attribute));
    } else if (type == ExpandoColumnConstants.FLOAT) {
        return GetterUtil.getFloat(attribute);
    } else if (type == ExpandoColumnConstants.FLOAT_ARRAY) {
        return GetterUtil.getFloatValues(StringUtil.split(attribute));
    } else if (type == ExpandoColumnConstants.INTEGER) {
        return GetterUtil.getInteger(attribute);
    } else if (type == ExpandoColumnConstants.INTEGER_ARRAY) {
        return GetterUtil.getIntegerValues(StringUtil.split(attribute));
    } else if (type == ExpandoColumnConstants.LONG) {
        return GetterUtil.getLong(attribute);
    } else if (type == ExpandoColumnConstants.LONG_ARRAY) {
        return GetterUtil.getLongValues(StringUtil.split(attribute));
    } else if (type == ExpandoColumnConstants.SHORT) {
        return GetterUtil.getShort(attribute);
    } else if (type == ExpandoColumnConstants.SHORT_ARRAY) {
        return GetterUtil.getShortValues(StringUtil.split(attribute));
    } else if (type == ExpandoColumnConstants.STRING_ARRAY) {
        return StringUtil.split(attribute);
    } else {
        return attribute;
    }
}