Example usage for org.apache.commons.lang.time FastDateFormat parseObject

List of usage examples for org.apache.commons.lang.time FastDateFormat parseObject

Introduction

In this page you can find the example usage for org.apache.commons.lang.time FastDateFormat parseObject.

Prototype

public Object parseObject(String source) throws ParseException 

Source Link

Document

Parses text from the beginning of the given string to produce an object.

Usage

From source file:com.intuit.tank.converter.DateConverter.java

/**
 * @{inheritDoc/*from w  w w .  java  2 s.  c  o  m*/
 */
@Override
public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value) {
    try {
        FastDateFormat fmt = DF;
        if (preferencesBean != null) {
            fmt = preferencesBean.getDateTimeFormat();
        }
        return fmt.parseObject(value);
    } catch (ParseException e) {
        // throw new IllegalArgumentException("Passed in value was not a valid date format in the pattern of " +
        // PATTERN);
        LOG.error("Cannot parse date value of" + value + ". Must be in the pattern of " + PATTERN);
    }
    return null;
}