cucumber.runtime.converters
Class ConverterWithFormat<T>

java.lang.Object
  extended by cucumber.runtime.converters.ConverterWithFormat<T>
All Implemented Interfaces:
com.thoughtworks.xstream.converters.ConverterMatcher, com.thoughtworks.xstream.converters.SingleValueConverter
Direct Known Subclasses:
ConverterWithEnumFormat, ConverterWithNumberFormat, TimeConverter

public abstract class ConverterWithFormat<T>
extends Object
implements com.thoughtworks.xstream.converters.SingleValueConverter


Constructor Summary
ConverterWithFormat(Class[] convertibleTypes)
           
 
Method Summary
 boolean canConvert(Class type)
           
 T fromString(String string)
           
protected abstract  List<? extends Format> getFormats()
           
 String toString(Object obj)
           
protected  Object transform(Format format, String argument)
          Parses a value using one of the java.util.text format classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterWithFormat

public ConverterWithFormat(Class[] convertibleTypes)
Method Detail

fromString

public T fromString(String string)
Specified by:
fromString in interface com.thoughtworks.xstream.converters.SingleValueConverter

getFormats

protected abstract List<? extends Format> getFormats()
Returns:
A Format to parse the argument

transform

protected Object transform(Format format,
                           String argument)
Parses a value using one of the java.util.text format classes.

Parameters:
format - The format to use
argument - The object to parse
Returns:
The object

toString

public String toString(Object obj)
Specified by:
toString in interface com.thoughtworks.xstream.converters.SingleValueConverter

canConvert

public boolean canConvert(Class type)
Specified by:
canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher


Copyright © 2012. All Rights Reserved.