org.specrunner.converters.core
Class ConverterTimestampCurrentTemplate

java.lang.Object
  extended by org.specrunner.converters.core.ConverterNotNullNotEmpty
      extended by org.specrunner.converters.core.AbstractConverterTimezone<T>
          extended by org.specrunner.converters.core.AbstractConverterTimeTemplate<Timestamp>
              extended by org.specrunner.converters.core.ConverterTimestampCurrentTemplate
All Implemented Interfaces:
Serializable, IConverter, IResetable
Direct Known Subclasses:
ConverterTimestampCurrent

public class ConverterTimestampCurrentTemplate
extends AbstractConverterTimeTemplate<Timestamp>

Create current date (in timestamp).

Author:
Thiago Santos
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.specrunner.converters.core.AbstractConverterTimezone
cacheTimezone, FEATURE_TIMEZONE
 
Constructor Summary
ConverterTimestampCurrentTemplate(String regexp)
          See superclass.
ConverterTimestampCurrentTemplate(String[] values)
          See superclass.
 
Method Summary
 Object convert(Object value, Object[] args)
          Convert a given object to another using some arguments as auxiliary.
protected  Calendar getCalendar()
          Get a calendar object based on timestamp.
protected  Timestamp instance()
          Creates an instance of date.
 
Methods inherited from class org.specrunner.converters.core.AbstractConverterTimezone
getTimezone, getZone, initialize, setTimezone
 
Methods inherited from class org.specrunner.converters.core.ConverterNotNullNotEmpty
accept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterTimestampCurrentTemplate

public ConverterTimestampCurrentTemplate(String regexp)
See superclass.

Parameters:
regexp - Regexp.

ConverterTimestampCurrentTemplate

public ConverterTimestampCurrentTemplate(String[] values)
See superclass.

Parameters:
values - Value.
Method Detail

instance

protected Timestamp instance()
Description copied from class: AbstractConverterTimeTemplate
Creates an instance of date.

Specified by:
instance in class AbstractConverterTimeTemplate<Timestamp>
Returns:
Something aka date.

getCalendar

protected Calendar getCalendar()
Get a calendar object based on timestamp.

Returns:
A calendar.

convert

public Object convert(Object value,
                      Object[] args)
               throws ConverterException
Description copied from interface: IConverter
Convert a given object to another using some arguments as auxiliary.

Specified by:
convert in interface IConverter
Overrides:
convert in class AbstractConverterTimeTemplate<Timestamp>
Parameters:
value - The value to be converted.
args - The arguments.
Returns:
The converted object.
Throws:
ConverterException - On conversion errors.


Copyright © 2014. All rights reserved.