Example usage for org.springframework.beans.propertyeditors ClassEditor ClassEditor

List of usage examples for org.springframework.beans.propertyeditors ClassEditor ClassEditor

Introduction

In this page you can find the example usage for org.springframework.beans.propertyeditors ClassEditor ClassEditor.

Prototype

public ClassEditor(@Nullable ClassLoader classLoader) 

Source Link

Document

Create a default ClassEditor, using the given ClassLoader.

Usage

From source file:org.eclipse.gemini.blueprint.context.support.OsgiPropertyEditorRegistrar.java

public void registerCustomEditors(PropertyEditorRegistry registry) {
    for (Map.Entry<Class<?>, Class<? extends PropertyEditor>> entry : editors.entrySet()) {
        Class<?> type = entry.getKey();
        PropertyEditor editorInstance;
        editorInstance = BeanUtils.instantiate(entry.getValue());
        registry.registerCustomEditor(type, editorInstance);
    }//from   w w w . j a  va2 s .  com

    // register non-externalized types
    registry.registerCustomEditor(Dictionary.class, new CustomMapEditor(Hashtable.class));
    registry.registerCustomEditor(Properties.class, new PropertiesEditor());
    registry.registerCustomEditor(Class.class, new ClassEditor(userClassLoader));
    registry.registerCustomEditor(Class[].class, new ClassArrayEditor(userClassLoader));
}