fitnesse.slim.converters.PropertyEditorConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitnesse Show documentation
Show all versions of fitnesse Show documentation
The fully integrated standalone wiki, and acceptance testing framework.
The newest version!
package fitnesse.slim.converters;
import java.beans.PropertyEditor;
import fitnesse.slim.Converter;
public class PropertyEditorConverter implements Converter {
private PropertyEditor editor;
public PropertyEditorConverter(PropertyEditor editor) {
this.editor = editor;
}
@Override
@SuppressWarnings("unchecked")
public T fromString(String arg) {
editor.setAsText(arg);
return (T) editor.getValue();
}
@Override
public String toString(Object o) {
editor.setValue(o);
return editor.getAsText();
}
}