org.specrunner.formatters.core
Class AbstractFormatterTime<T>

java.lang.Object
  extended by org.specrunner.formatters.core.AbstractFormatterTime<T>
Type Parameters:
T - Any object.
All Implemented Interfaces:
Serializable, IFormatter, IResetable
Direct Known Subclasses:
FormatterDate, FormatterJodatime

public abstract class AbstractFormatterTime<T>
extends Object
implements IFormatter

Create time pattern formatter.

Author:
Thiago Santos
See Also:
Serialized Form

Field Summary
protected  ICache<String,T> cache
          Cache of formatters.
 
Constructor Summary
AbstractFormatterTime()
           
 
Method Summary
 String format(Object value, Object[] args)
          Format a given object to another using some arguments as auxiliary.
protected abstract  String format(T pattern, Object value, Object[] args)
           
 void initialize()
          Initialize something.
protected abstract  T newInstance(String str)
           
protected abstract  boolean testType(Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected ICache<String,T> cache
Cache of formatters.

Constructor Detail

AbstractFormatterTime

public AbstractFormatterTime()
Method Detail

initialize

public void initialize()
Description copied from interface: IResetable
Initialize something.

Specified by:
initialize in interface IResetable

format

public String format(Object value,
                     Object[] args)
              throws FormatterException
Description copied from interface: IFormatter
Format a given object to another using some arguments as auxiliary.

Specified by:
format in interface IFormatter
Parameters:
value - The value to be formatted.
args - The arguments.
Returns:
The formatted object.
Throws:
FormatterException - On format errors.

testType

protected abstract boolean testType(Object value)

newInstance

protected abstract T newInstance(String str)

format

protected abstract String format(T pattern,
                                 Object value,
                                 Object[] args)


Copyright © 2015. All rights reserved.