Example usage for java.beans PropertyEditor getClass

List of usage examples for java.beans PropertyEditor getClass

Introduction

In this page you can find the example usage for java.beans PropertyEditor getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.tinygroup.beanwrapper.TypeConverterDelegate.java

/**
 * Convert the given text value using the given property editor.
 * @param oldValue the previous value, if available (may be <code>null</code>)
 * @param newTextValue the proposed text value
 * @param editor the PropertyEditor to use
 * @return the converted value//from  www.  ja  va  2  s .c  om
 */
protected Object doConvertTextValue(Object oldValue, String newTextValue, PropertyEditor editor) {
    try {
        editor.setValue(oldValue);
    } catch (Exception ex) {
        if (logger.isDebugEnabled()) {
            logger.debug("PropertyEditor [" + editor.getClass().getName() + "] does not support setValue call",
                    ex);
        }
        // Swallow and proceed.
    }
    editor.setAsText(newTextValue);
    return editor.getValue();
}