Example usage for java.beans PropertyEditorSupport setAsText

List of usage examples for java.beans PropertyEditorSupport setAsText

Introduction

In this page you can find the example usage for java.beans PropertyEditorSupport setAsText.

Prototype

public void setAsText(String text) throws java.lang.IllegalArgumentException 

Source Link

Document

Sets the property value by parsing a given String.

Usage

From source file:test.automation.operator.AbstractReflectionFormHandler.java

public Object getValueAsObject(final Field field, final String textValue) {
    // 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.setAsText(textValue);
            return (propertyEditor.getValue());
        }/*from www.j a v a2s  . co m*/
    }

    return (textValue);
}