org.specrunner.converters.core
Class ConverterDateTimeCurrentTemplate

java.lang.Object
  extended by org.specrunner.converters.core.ConverterDefault
      extended by org.specrunner.converters.core.ConverterNotNullNotEmpty
          extended by org.specrunner.converters.core.AbstractConverterTimezone<T>
              extended by org.specrunner.converters.core.AbstractConverterTimeTemplate<org.joda.time.DateTime>
                  extended by org.specrunner.converters.core.ConverterDateTimeCurrentTemplate
All Implemented Interfaces:
Serializable, IConverter, IResetable
Direct Known Subclasses:
ConverterDateTimeCurrent

public class ConverterDateTimeCurrentTemplate
extends AbstractConverterTimeTemplate<org.joda.time.DateTime>

Create current date.

Author:
Thiago Santos
See Also:
Serialized Form

Field Summary
protected  Map<String,String> aliasToField
           
protected  Map<String,String> fieldToMethod
           
protected  Pattern pattern
           
 
Fields inherited from class org.specrunner.converters.core.AbstractConverterTimeTemplate
values
 
Fields inherited from class org.specrunner.converters.core.AbstractConverterTimezone
cacheTimezone, FEATURE_TIMEZONE, timezone
 
Constructor Summary
ConverterDateTimeCurrentTemplate(List<String> values)
          See superclass.
 
Method Summary
protected  Map<String,String> bindAliases(Map<String,String> map)
           
protected  Map<String,String> bindPatterns(Map<String,String> map)
           
 Object convert(Object value, Object[] args)
          Convert a given object to another using some arguments as auxiliary.
protected  Pattern extractPattern(Set<String> set)
           
protected  org.joda.time.DateTime instance()
          Creates an instance of date.
protected  org.joda.time.DateTime postProcess(Object value, Object[] args, org.joda.time.DateTime result)
          Post process a instance of data.
protected  boolean testValue(String str, String value)
          Test the string against a value.
 
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
 

Field Detail

aliasToField

protected Map<String,String> aliasToField

fieldToMethod

protected Map<String,String> fieldToMethod

pattern

protected Pattern pattern
Constructor Detail

ConverterDateTimeCurrentTemplate

public ConverterDateTimeCurrentTemplate(List<String> values)
See superclass.

Parameters:
values - Value.
Method Detail

bindAliases

protected Map<String,String> bindAliases(Map<String,String> map)

bindPatterns

protected Map<String,String> bindPatterns(Map<String,String> map)

extractPattern

protected Pattern extractPattern(Set<String> set)

testValue

protected boolean testValue(String str,
                            String value)
Description copied from class: AbstractConverterTimeTemplate
Test the string against a value.

Overrides:
testValue in class AbstractConverterTimeTemplate<org.joda.time.DateTime>
Parameters:
str - String.
value - A value.
Returns:
true, if valid, false, otherwise.

instance

protected org.joda.time.DateTime instance()
Description copied from class: AbstractConverterTimeTemplate
Creates an instance of date.

Specified by:
instance in class AbstractConverterTimeTemplate<org.joda.time.DateTime>
Returns:
Something aka date.

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<org.joda.time.DateTime>
Parameters:
value - The value to be converted.
args - The arguments.
Returns:
The converted object.
Throws:
ConverterException - On conversion errors.

postProcess

protected org.joda.time.DateTime postProcess(Object value,
                                             Object[] args,
                                             org.joda.time.DateTime result)
Description copied from class: AbstractConverterTimeTemplate
Post process a instance of data.

Overrides:
postProcess in class AbstractConverterTimeTemplate<org.joda.time.DateTime>
Parameters:
value - The original value.
args - The arguments.
result - The result.
Returns:
A time processed. i.e. plusDays, if specified.


Copyright © 2015. All rights reserved.