Java Code Examples for java.beans.Introspector#setBeanInfoSearchPath()

The following examples show how to use java.beans.Introspector#setBeanInfoSearchPath() . 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: TestBeanInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void run() {
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);

    Introspector.setBeanInfoSearchPath(SEARCH_PATH);
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, SecondBeanBeanInfo.class);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);
}
 
Example 2
Source File: TestBeanInfo.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void run() {
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);

    Introspector.setBeanInfoSearchPath(SEARCH_PATH);
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, SecondBeanBeanInfo.class);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);
}
 
Example 3
Source File: TestBeanInfo.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void run() {
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);

    Introspector.setBeanInfoSearchPath(SEARCH_PATH);
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, SecondBeanBeanInfo.class);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);
}
 
Example 4
Source File: TestBeanInfo.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void run() {
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);

    Introspector.setBeanInfoSearchPath(SEARCH_PATH);
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, SecondBeanBeanInfo.class);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);
}
 
Example 5
Source File: TestBeanInfo.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void run() {
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);

    Introspector.setBeanInfoSearchPath(SEARCH_PATH);
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, SecondBeanBeanInfo.class);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);
}
 
Example 6
Source File: Test4168475.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws IntrospectionException {
    Introspector.setBeanInfoSearchPath(PATH);
    BeanInfo info = Introspector.getBeanInfo(Component.class);
    PropertyDescriptor[] pds = info.getPropertyDescriptors();

    // The custom ComponentBeanInfo we deliver
    // only provides a single property.

    if (pds.length != 1) {
        throw new Error("wrong number of properties");
    }
    if (!pds[0].getName().equals("name")) {
        throw new Error("unexpected property name");
    }
}
 
Example 7
Source File: Test4080522.java    From hottub 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 8
Source File: Test4520754.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This is a regression test to ensure that 4168475 does not regress.
 */
private static void test4168475(Class type) {
    String[] newPath = {"infos"};
    String[] oldPath = Introspector.getBeanInfoSearchPath();

    Introspector.setBeanInfoSearchPath(newPath);
    BeanInfo info = getBeanInfo(Boolean.TRUE, type);
    Introspector.setBeanInfoSearchPath(oldPath);

    PropertyDescriptor[] pds = info.getPropertyDescriptors();
    if (pds.length != 1) {
        throw new Error("could not find custom BeanInfo for " + type);
    }
    Introspector.flushCaches();
}
 
Example 9
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 10
Source File: Test4520754.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This is a regression test to ensure that 4168475 does not regress.
 */
private static void test4168475(Class type) {
    String[] newPath = {"infos"};
    String[] oldPath = Introspector.getBeanInfoSearchPath();

    Introspector.setBeanInfoSearchPath(newPath);
    BeanInfo info = getBeanInfo(Boolean.TRUE, type);
    Introspector.setBeanInfoSearchPath(oldPath);

    PropertyDescriptor[] pds = info.getPropertyDescriptors();
    if (pds.length != 1) {
        throw new Error("could not find custom BeanInfo for " + type);
    }
    Introspector.flushCaches();
}
 
Example 11
Source File: Test4168475.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws IntrospectionException {
    Introspector.setBeanInfoSearchPath(PATH);
    BeanInfo info = Introspector.getBeanInfo(Component.class);
    PropertyDescriptor[] pds = info.getPropertyDescriptors();

    // The custom ComponentBeanInfo we deliver
    // only provides a single property.

    if (pds.length != 1) {
        throw new Error("wrong number of properties");
    }
    if (!pds[0].getName().equals("name")) {
        throw new Error("unexpected property name");
    }
}
 
Example 12
Source File: Test4168475.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws IntrospectionException {
    Introspector.setBeanInfoSearchPath(PATH);
    BeanInfo info = Introspector.getBeanInfo(Component.class);
    PropertyDescriptor[] pds = info.getPropertyDescriptors();

    // The custom ComponentBeanInfo we deliver
    // only provides a single property.

    if (pds.length != 1) {
        throw new Error("wrong number of properties");
    }
    if (!pds[0].getName().equals("name")) {
        throw new Error("unexpected property name");
    }
}
 
Example 13
Source File: Test4080522.java    From jdk8u60 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 14
Source File: Test4168475.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws IntrospectionException {
    Introspector.setBeanInfoSearchPath(PATH);
    BeanInfo info = Introspector.getBeanInfo(Component.class);
    PropertyDescriptor[] pds = info.getPropertyDescriptors();

    // The custom ComponentBeanInfo we deliver
    // only provides a single property.

    if (pds.length != 1) {
        throw new Error("wrong number of properties");
    }
    if (!pds[0].getName().equals("name")) {
        throw new Error("unexpected property name");
    }
}
 
Example 15
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 16
Source File: Test4520754.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This is a regression test to ensure that 4168475 does not regress.
 */
private static void test4168475(Class type) {
    String[] newPath = {"infos"};
    String[] oldPath = Introspector.getBeanInfoSearchPath();

    Introspector.setBeanInfoSearchPath(newPath);
    BeanInfo info = getBeanInfo(Boolean.TRUE, type);
    Introspector.setBeanInfoSearchPath(oldPath);

    PropertyDescriptor[] pds = info.getPropertyDescriptors();
    if (pds.length != 1) {
        throw new Error("could not find custom BeanInfo for " + type);
    }
    Introspector.flushCaches();
}
 
Example 17
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 18
Source File: Test4168475.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws IntrospectionException {
    Introspector.setBeanInfoSearchPath(PATH);
    BeanInfo info = Introspector.getBeanInfo(Component.class);
    PropertyDescriptor[] pds = info.getPropertyDescriptors();

    // The custom ComponentBeanInfo we deliver
    // only provides a single property.

    if (pds.length != 1) {
        throw new Error("wrong number of properties");
    }
    if (!pds[0].getName().equals("name")) {
        throw new Error("unexpected property name");
    }
}
 
Example 19
Source File: IntrospectorTest.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@Override
protected void tearDown() throws Exception {
    super.tearDown();
    Introspector.flushCaches();
    Introspector.setBeanInfoSearchPath(defaultPackage);
}