Java Code Examples for java.beans.PropertyEditorManager#setEditorSearchPath()

The following examples show how to use java.beans.PropertyEditorManager#setEditorSearchPath() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Test4080522.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void test(String[] path) {
    try {
        Beans.setDesignTime(true);
        Beans.setGuiAvailable(true);
        Introspector.setBeanInfoSearchPath(path);
        PropertyEditorManager.setEditorSearchPath(path);
    } catch (SecurityException exception) {
        throw new Error("unexpected security exception", exception);
    }
}
 
Example 2
Source File: Test4080522.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void test(String[] path) {
    try {
        Beans.setDesignTime(true);
        Beans.setGuiAvailable(true);
        Introspector.setBeanInfoSearchPath(path);
        PropertyEditorManager.setEditorSearchPath(path);
    } catch (SecurityException exception) {
        throw new Error("unexpected security exception", exception);
    }
}
 
Example 3
Source File: Test4080522.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void test(String[] path) {
    try {
        Beans.setDesignTime(true);
        Beans.setGuiAvailable(true);
        Introspector.setBeanInfoSearchPath(path);
        PropertyEditorManager.setEditorSearchPath(path);
    } catch (SecurityException exception) {
        throw new Error("unexpected security exception", exception);
    }
}
 
Example 4
Source File: Test4968709.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    String[] oldPath = PropertyEditorManager.getEditorSearchPath();
    String[] newPath = {"aaa.bbb", "aaa.ccc",};
    PropertyEditorManager.setEditorSearchPath(newPath);
    if (null != PropertyEditorManager.findEditor(Test4968709.class))
        throw new Error("found unexpected editor");

    PropertyEditorManager.setEditorSearchPath(oldPath);
    if (null == PropertyEditorManager.findEditor(Double.TYPE))
        throw new Error("expected editor is not found");
}
 
Example 5
Source File: Test4968709.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    String[] oldPath = PropertyEditorManager.getEditorSearchPath();
    String[] newPath = {"aaa.bbb", "aaa.ccc",};
    PropertyEditorManager.setEditorSearchPath(newPath);
    if (null != PropertyEditorManager.findEditor(Test4968709.class))
        throw new Error("found unexpected editor");

    PropertyEditorManager.setEditorSearchPath(oldPath);
    if (null == PropertyEditorManager.findEditor(Double.TYPE))
        throw new Error("expected editor is not found");
}
 
Example 6
Source File: Test4968709.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    String[] oldPath = PropertyEditorManager.getEditorSearchPath();
    String[] newPath = {"aaa.bbb", "aaa.ccc",};
    PropertyEditorManager.setEditorSearchPath(newPath);
    if (null != PropertyEditorManager.findEditor(Test4968709.class))
        throw new Error("found unexpected editor");

    PropertyEditorManager.setEditorSearchPath(oldPath);
    if (null == PropertyEditorManager.findEditor(Double.TYPE))
        throw new Error("expected editor is not found");
}
 
Example 7
Source File: Test4968709.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    String[] oldPath = PropertyEditorManager.getEditorSearchPath();
    String[] newPath = {"aaa.bbb", "aaa.ccc",};
    PropertyEditorManager.setEditorSearchPath(newPath);
    if (null != PropertyEditorManager.findEditor(Test4968709.class))
        throw new Error("found unexpected editor");

    PropertyEditorManager.setEditorSearchPath(oldPath);
    if (null == PropertyEditorManager.findEditor(Double.TYPE))
        throw new Error("expected editor is not found");
}
 
Example 8
Source File: Test4080522.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void test(String[] path) {
    try {
        Beans.setDesignTime(true);
        Beans.setGuiAvailable(true);
        Introspector.setBeanInfoSearchPath(path);
        PropertyEditorManager.setEditorSearchPath(path);
    } catch (SecurityException exception) {
        throw new Error("unexpected security exception", exception);
    }
}
 
Example 9
Source File: Test4080522.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void test(String[] path) {
    try {
        Beans.setDesignTime(true);
        Beans.setGuiAvailable(true);
        Introspector.setBeanInfoSearchPath(path);
        PropertyEditorManager.setEditorSearchPath(path);
    } catch (SecurityException exception) {
        throw new Error("unexpected security exception", exception);
    }
}
 
Example 10
Source File: Test4968709.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    String[] oldPath = PropertyEditorManager.getEditorSearchPath();
    String[] newPath = {"aaa.bbb", "aaa.ccc",};
    PropertyEditorManager.setEditorSearchPath(newPath);
    if (null != PropertyEditorManager.findEditor(Test4968709.class))
        throw new Error("found unexpected editor");

    PropertyEditorManager.setEditorSearchPath(oldPath);
    if (null == PropertyEditorManager.findEditor(Double.TYPE))
        throw new Error("expected editor is not found");
}
 
Example 11
Source File: Test4968709.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    String[] oldPath = PropertyEditorManager.getEditorSearchPath();
    String[] newPath = {"aaa.bbb", "aaa.ccc",};
    PropertyEditorManager.setEditorSearchPath(newPath);
    if (null != PropertyEditorManager.findEditor(Test4968709.class))
        throw new Error("found unexpected editor");

    PropertyEditorManager.setEditorSearchPath(oldPath);
    if (null == PropertyEditorManager.findEditor(Double.TYPE))
        throw new Error("expected editor is not found");
}
 
Example 12
Source File: TestPropertyEditor.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void run() {
    PropertyEditorManager.registerEditor(ThirdBean.class, ThirdBeanEditor.class);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, ByteEditor.class);
    test(Short.class, ShortEditor.class);
    test(Integer.class, IntegerEditor.class);
    test(Long.class, LongEditor.class);
    test(Boolean.class, BooleanEditor.class);
    test(Float.class, FloatEditor.class);
    test(Double.class, DoubleEditor.class);
    test(String.class, StringEditor.class);
    test(Color.class, ColorEditor.class);
    test(Font.class, FontEditor.class);
    test(Enumeration.class, EnumEditor.class);

    PropertyEditorManager.registerEditor(ThirdBean.class, null);
    PropertyEditorManager.setEditorSearchPath(SEARCH_PATH);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, SecondBeanEditor.class);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, null);
    test(Short.class, null);
    test(Integer.class, null);
    test(Long.class, null);
    test(Boolean.class, null);
    test(Float.class, null);
    test(Double.class, null);
    test(String.class, null);
    test(Color.class, null);
    test(Font.class, null);
    test(Enumeration.class, EnumEditor.class);
}
 
Example 13
Source File: TestPropertyEditor.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void run() {
    PropertyEditorManager.registerEditor(ThirdBean.class, ThirdBeanEditor.class);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, ByteEditor.class);
    test(Short.class, ShortEditor.class);
    test(Integer.class, IntegerEditor.class);
    test(Long.class, LongEditor.class);
    test(Boolean.class, BooleanEditor.class);
    test(Float.class, FloatEditor.class);
    test(Double.class, DoubleEditor.class);
    test(String.class, StringEditor.class);
    test(Color.class, ColorEditor.class);
    test(Font.class, FontEditor.class);
    test(Enumeration.class, EnumEditor.class);

    PropertyEditorManager.registerEditor(ThirdBean.class, null);
    PropertyEditorManager.setEditorSearchPath(SEARCH_PATH);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, SecondBeanEditor.class);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, null);
    test(Short.class, null);
    test(Integer.class, null);
    test(Long.class, null);
    test(Boolean.class, null);
    test(Float.class, null);
    test(Double.class, null);
    test(String.class, null);
    test(Color.class, null);
    test(Font.class, null);
    test(Enumeration.class, EnumEditor.class);
}
 
Example 14
Source File: TestPropertyEditor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void run() {
    PropertyEditorManager.registerEditor(ThirdBean.class, ThirdBeanEditor.class);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, ByteEditor.class);
    test(Short.class, ShortEditor.class);
    test(Integer.class, IntegerEditor.class);
    test(Long.class, LongEditor.class);
    test(Boolean.class, BooleanEditor.class);
    test(Float.class, FloatEditor.class);
    test(Double.class, DoubleEditor.class);
    test(String.class, StringEditor.class);
    test(Color.class, ColorEditor.class);
    test(Font.class, FontEditor.class);
    test(Enumeration.class, EnumEditor.class);

    PropertyEditorManager.registerEditor(ThirdBean.class, null);
    PropertyEditorManager.setEditorSearchPath(SEARCH_PATH);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, SecondBeanEditor.class);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, null);
    test(Short.class, null);
    test(Integer.class, null);
    test(Long.class, null);
    test(Boolean.class, null);
    test(Float.class, null);
    test(Double.class, null);
    test(String.class, null);
    test(Color.class, null);
    test(Font.class, null);
    test(Enumeration.class, EnumEditor.class);
}
 
Example 15
Source File: NodesRegistrationSupport.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public static synchronized void registerPropertyEditors() {
    
    if (clsReg == null) {
        clsReg = new AbstractRegistrator(PEClassRegistration.class) {

            @Override
            void register() {
                ClassLoader clsLoader = findClsLoader();
                for (Iterator<PEClassRegistration> it = lookupResult.allInstances().iterator(); it.hasNext();) {
                    PEClassRegistration clsReg = it.next();
                    for (String type : clsReg.targetTypes) {
                        try {
                            Class<?> cls = getClassFromCanonicalName(type);
                            Class<?> editorCls = Class.forName(clsReg.editorClass, true, clsLoader);
                            PropertyEditorManager.registerEditor(cls, editorCls);
                        } catch (ClassNotFoundException ex) {
                            Exceptions.printStackTrace(ex);
                        }
                    }
                }
            }

            @Override
            void init() {
            }
        };
    } else {
        clsReg.register();
    }
    
    if (pkgReg == null) {
        pkgReg = new AbstractRegistrator(PEPackageRegistration.class) {

            @Override
            void register() {
                Set<String> newPath = new LinkedHashSet<String> ();
                for (Iterator<PEPackageRegistration> it = lookupResult.allInstances().iterator(); it.hasNext();) {
                    PEPackageRegistration pkgReg = it.next();
                    newPath.add(pkgReg.pkg);
                }
                newPath.addAll(originalPath);
                PropertyEditorManager.setEditorSearchPath(newPath.toArray(new String[newPath.size()]));
            }

            @Override
            void init() {
                if (originalPath == null) {
                    originalPath = Arrays.asList(PropertyEditorManager.getEditorSearchPath());
                }
            }
        };
    } else {
        pkgReg.register();
    }
    
    if (beanInfoReg == null) {
        beanInfoReg = new AbstractRegistrator(BeanInfoRegistration.class) {

            @Override
            void register() {
                Set<String> newPath = new LinkedHashSet<String> ();
                for (Iterator<BeanInfoRegistration> it = lookupResult.allInstances().iterator(); it.hasNext();) {
                    BeanInfoRegistration biReg = it.next();
                    newPath.add(biReg.searchPath);
                }
                newPath.addAll(originalBeanInfoSearchPath);
                Introspector.setBeanInfoSearchPath(newPath.toArray(new String[newPath.size()]));
            }

            @Override
            void init() {
                if (originalBeanInfoSearchPath == null) {
                originalBeanInfoSearchPath = Arrays.asList(Introspector.getBeanInfoSearchPath());
                }
            }
        };
    } else {
        beanInfoReg.register();
    }
}
 
Example 16
Source File: TestPropertyEditor.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void run() {
    PropertyEditorManager.registerEditor(ThirdBean.class, ThirdBeanEditor.class);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, ByteEditor.class);
    test(Short.class, ShortEditor.class);
    test(Integer.class, IntegerEditor.class);
    test(Long.class, LongEditor.class);
    test(Boolean.class, BooleanEditor.class);
    test(Float.class, FloatEditor.class);
    test(Double.class, DoubleEditor.class);
    test(String.class, StringEditor.class);
    test(Color.class, ColorEditor.class);
    test(Font.class, FontEditor.class);
    test(Enumeration.class, EnumEditor.class);

    PropertyEditorManager.registerEditor(ThirdBean.class, null);
    PropertyEditorManager.setEditorSearchPath(SEARCH_PATH);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, SecondBeanEditor.class);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, null);
    test(Short.class, null);
    test(Integer.class, null);
    test(Long.class, null);
    test(Boolean.class, null);
    test(Float.class, null);
    test(Double.class, null);
    test(String.class, null);
    test(Color.class, null);
    test(Font.class, null);
    test(Enumeration.class, EnumEditor.class);
}
 
Example 17
Source File: TestPropertyEditor.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void run() {
    PropertyEditorManager.registerEditor(ThirdBean.class, ThirdBeanEditor.class);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, ByteEditor.class);
    test(Short.class, ShortEditor.class);
    test(Integer.class, IntegerEditor.class);
    test(Long.class, LongEditor.class);
    test(Boolean.class, BooleanEditor.class);
    test(Float.class, FloatEditor.class);
    test(Double.class, DoubleEditor.class);
    test(String.class, StringEditor.class);
    test(Color.class, ColorEditor.class);
    test(Font.class, FontEditor.class);
    test(Enumeration.class, EnumEditor.class);

    PropertyEditorManager.registerEditor(ThirdBean.class, null);
    PropertyEditorManager.setEditorSearchPath(SEARCH_PATH);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, SecondBeanEditor.class);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, null);
    test(Short.class, null);
    test(Integer.class, null);
    test(Long.class, null);
    test(Boolean.class, null);
    test(Float.class, null);
    test(Double.class, null);
    test(String.class, null);
    test(Color.class, null);
    test(Font.class, null);
    test(Enumeration.class, EnumEditor.class);
}
 
Example 18
Source File: TestPropertyEditor.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void run() {
    PropertyEditorManager.registerEditor(ThirdBean.class, ThirdBeanEditor.class);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, ByteEditor.class);
    test(Short.class, ShortEditor.class);
    test(Integer.class, IntegerEditor.class);
    test(Long.class, LongEditor.class);
    test(Boolean.class, BooleanEditor.class);
    test(Float.class, FloatEditor.class);
    test(Double.class, DoubleEditor.class);
    test(String.class, StringEditor.class);
    test(Color.class, ColorEditor.class);
    test(Font.class, FontEditor.class);
    test(Enumeration.class, EnumEditor.class);

    PropertyEditorManager.registerEditor(ThirdBean.class, null);
    PropertyEditorManager.setEditorSearchPath(SEARCH_PATH);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, SecondBeanEditor.class);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, null);
    test(Short.class, null);
    test(Integer.class, null);
    test(Long.class, null);
    test(Boolean.class, null);
    test(Float.class, null);
    test(Double.class, null);
    test(String.class, null);
    test(Color.class, null);
    test(Font.class, null);
    test(Enumeration.class, EnumEditor.class);
}
 
Example 19
Source File: TestPropertyEditor.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void run() {
    PropertyEditorManager.registerEditor(ThirdBean.class, ThirdBeanEditor.class);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, ByteEditor.class);
    test(Short.class, ShortEditor.class);
    test(Integer.class, IntegerEditor.class);
    test(Long.class, LongEditor.class);
    test(Boolean.class, BooleanEditor.class);
    test(Float.class, FloatEditor.class);
    test(Double.class, DoubleEditor.class);
    test(String.class, StringEditor.class);
    test(Color.class, ColorEditor.class);
    test(Font.class, FontEditor.class);
    test(Enumeration.class, EnumEditor.class);

    PropertyEditorManager.registerEditor(ThirdBean.class, null);
    PropertyEditorManager.setEditorSearchPath(SEARCH_PATH);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, SecondBeanEditor.class);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, null);
    test(Short.class, null);
    test(Integer.class, null);
    test(Long.class, null);
    test(Boolean.class, null);
    test(Float.class, null);
    test(Double.class, null);
    test(String.class, null);
    test(Color.class, null);
    test(Font.class, null);
    test(Enumeration.class, EnumEditor.class);
}
 
Example 20
Source File: TestPropertyEditor.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void run() {
    PropertyEditorManager.registerEditor(ThirdBean.class, ThirdBeanEditor.class);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, ByteEditor.class);
    test(Short.class, ShortEditor.class);
    test(Integer.class, IntegerEditor.class);
    test(Long.class, LongEditor.class);
    test(Boolean.class, BooleanEditor.class);
    test(Float.class, FloatEditor.class);
    test(Double.class, DoubleEditor.class);
    test(String.class, StringEditor.class);
    test(Color.class, ColorEditor.class);
    test(Font.class, FontEditor.class);
    test(Enumeration.class, EnumEditor.class);

    PropertyEditorManager.registerEditor(ThirdBean.class, null);
    PropertyEditorManager.setEditorSearchPath(SEARCH_PATH);

    test(FirstBean.class, FirstBeanEditor.class);
    test(SecondBean.class, SecondBeanEditor.class);
    test(ThirdBean.class, ThirdBeanEditor.class);
    // test editors for default primitive types
    test(Byte.TYPE, ByteEditor.class);
    test(Short.TYPE, ShortEditor.class);
    test(Integer.TYPE, IntegerEditor.class);
    test(Long.TYPE, LongEditor.class);
    test(Boolean.TYPE, BooleanEditor.class);
    test(Float.TYPE, FloatEditor.class);
    test(Double.TYPE, DoubleEditor.class);
    // test editors for default object types
    test(Byte.class, null);
    test(Short.class, null);
    test(Integer.class, null);
    test(Long.class, null);
    test(Boolean.class, null);
    test(Float.class, null);
    test(Double.class, null);
    test(String.class, null);
    test(Color.class, null);
    test(Font.class, null);
    test(Enumeration.class, EnumEditor.class);
}