All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cucumber.runtime.xstream.CalendarConverter Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
package cucumber.runtime.xstream;

import java.text.Format;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

class CalendarConverter extends TimeConverter {
    public CalendarConverter(Locale locale) {
        super(locale, new Class[]{Calendar.class});
    }

    @Override
    protected Object transform(Format format, String argument) {
        Date date = (Date) super.transform(format, argument);
        Calendar cal = Calendar.getInstance(getLocale());
        cal.setTime(date);
        return cal;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy