xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/PropertyEditorHelper.java [39:80]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected static void registerEditor(String typeName, String editorName) {
        Class type = loadClass(typeName);
        Class editor = loadClass(editorName);
        if (type != null && editor != null) {
            PropertyEditorManager.registerEditor(type, editor);
        }
    }

    public static void unregisterCustomEditors() {
        unregisterEditor("java.io.File");
        unregisterEditor("java.net.URI");
        unregisterEditor("java.util.Date");
        unregisterEditor("javax.management.ObjectName");
    }

    protected static void unregisterEditor(String typeName) {
        Class type = loadClass(typeName);
        if (type != null) {
            PropertyEditorManager.registerEditor(type, null);
        }
    }
    public static Class loadClass(String name) {
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        if (contextClassLoader != null) {
            try {
                return contextClassLoader.loadClass(name);
            }
            catch (ClassNotFoundException e) {
            }
            catch (NoClassDefFoundError e) {
            }
        }
        try {
            return PropertyEditorHelper.class.getClassLoader().loadClass(name);
        }
        catch (ClassNotFoundException e) {
            log.debug("Could not find class: " + name + " on the classpath");
            return null;
        }
        catch (NoClassDefFoundError e) {
            log.debug("Could not load class: " + name + " on the classpath. " + e.getMessage());
            return null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



xbean-spring/src/main/java/org/apache/xbean/spring/context/impl/PropertyEditorHelper.java [39:80]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected static void registerEditor(String typeName, String editorName) {
        Class type = loadClass(typeName);
        Class editor = loadClass(editorName);
        if (type != null && editor != null) {
            PropertyEditorManager.registerEditor(type, editor);
        }
    }

    public static void unregisterCustomEditors() {
        unregisterEditor("java.io.File");
        unregisterEditor("java.net.URI");
        unregisterEditor("java.util.Date");
        unregisterEditor("javax.management.ObjectName");
    }

    protected static void unregisterEditor(String typeName) {
        Class type = loadClass(typeName);
        if (type != null) {
            PropertyEditorManager.registerEditor(type, null);
        }
    }
    public static Class loadClass(String name) {
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        if (contextClassLoader != null) {
            try {
                return contextClassLoader.loadClass(name);
            }
            catch (ClassNotFoundException e) {
            }
            catch (NoClassDefFoundError e) {
            }
        }
        try {
            return PropertyEditorHelper.class.getClassLoader().loadClass(name);
        }
        catch (ClassNotFoundException e) {
            log.debug("Could not find class: " + name + " on the classpath");
            return null;
        }
        catch (NoClassDefFoundError e) {
            log.debug("Could not load class: " + name + " on the classpath. " + e.getMessage());
            return null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



