All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fitnesse.slim.converters.PropertyEditorConverter Maven / Gradle / Ivy

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();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy