List of usage examples for java.beans PropertyEditorSupport getAsText
public String getAsText()
From source file:test.automation.operator.AbstractReflectionFormHandler.java
/** * Useful for converting a date into a string representation, or serializing an entity, etc.. * @param field the field in the POJO./* w w w . j a v a 2 s.co m*/ * @param entity the entity holding the POJO's state. * @return */ public String getValueAsText(final Field field, final Object value) { // convert the Object into a string representation using a property editor. if (propertyEditors != null) { final PropertyEditorSupport propertyEditor = propertyEditors.get(field.getType()); if (propertyEditor != null) { propertyEditor.setValue(value); return (propertyEditor.getAsText()); } } return (value.toString()); }