Search in sources :

Example 16 with IndexedPropertyDescriptor

use of java.beans.IndexedPropertyDescriptor in project j2objc by google.

the class IntrospectorTest method test_MixedBooleanSimpleClass24.

public void test_MixedBooleanSimpleClass24() throws Exception {
    BeanInfo info = Introspector.getBeanInfo(MixedBooleanSimpleClass24.class);
    Method setter = MixedBooleanSimpleClass24.class.getDeclaredMethod("setList", int.class, boolean.class);
    for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
        if (propertyName.equals(pd.getName())) {
            assertTrue(pd instanceof IndexedPropertyDescriptor);
            assertNull(pd.getReadMethod());
            assertNull(pd.getWriteMethod());
            assertNull(((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
            assertEquals(setter, ((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
        }
    }
}
Also used : IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) PropertyDescriptor(java.beans.PropertyDescriptor) BeanInfo(java.beans.BeanInfo) SimpleBeanInfo(java.beans.SimpleBeanInfo) FakeFox01BeanInfo(org.apache.harmony.beans.tests.support.mock.FakeFox01BeanInfo) IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) Method(java.lang.reflect.Method)

Example 17 with IndexedPropertyDescriptor

use of java.beans.IndexedPropertyDescriptor in project j2objc by google.

the class IntrospectorTest method test_MixedBooleanExtendClass7.

public void test_MixedBooleanExtendClass7() throws Exception {
    BeanInfo info = Introspector.getBeanInfo(MixedBooleanExtendClass7.class);
    Method setter = MixedBooleanSimpleClass25.class.getDeclaredMethod("setList", int.class, boolean.class);
    for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
        if (propertyName.equals(pd.getName())) {
            assertTrue(pd instanceof IndexedPropertyDescriptor);
            assertNull(pd.getReadMethod());
            assertNull(pd.getWriteMethod());
            assertNull(((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
            assertEquals(setter, ((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
            break;
        }
    }
}
Also used : IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) PropertyDescriptor(java.beans.PropertyDescriptor) BeanInfo(java.beans.BeanInfo) SimpleBeanInfo(java.beans.SimpleBeanInfo) FakeFox01BeanInfo(org.apache.harmony.beans.tests.support.mock.FakeFox01BeanInfo) IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) Method(java.lang.reflect.Method)

Example 18 with IndexedPropertyDescriptor

use of java.beans.IndexedPropertyDescriptor in project j2objc by google.

the class IntrospectorTest method test_MixedSimpleClass30.

public void test_MixedSimpleClass30() throws Exception {
    BeanInfo info = Introspector.getBeanInfo(MixedSimpleClass30.class);
    Method indexedGetter = MixedSimpleClass30.class.getDeclaredMethod("getList", int.class);
    for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
        if (propertyName.equals(pd.getName())) {
            assertTrue(pd instanceof IndexedPropertyDescriptor);
            assertNull(pd.getReadMethod());
            assertNull(pd.getWriteMethod());
            assertEquals(indexedGetter, ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
            assertNull(((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
        }
    }
}
Also used : IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) PropertyDescriptor(java.beans.PropertyDescriptor) BeanInfo(java.beans.BeanInfo) SimpleBeanInfo(java.beans.SimpleBeanInfo) FakeFox01BeanInfo(org.apache.harmony.beans.tests.support.mock.FakeFox01BeanInfo) IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) Method(java.lang.reflect.Method)

Example 19 with IndexedPropertyDescriptor

use of java.beans.IndexedPropertyDescriptor in project j2objc by google.

the class IntrospectorTest method testMockIncompatibleAllSetterAndGetterBean.

public void testMockIncompatibleAllSetterAndGetterBean() throws Exception {
    Class<?> beanClass = MockIncompatibleAllSetterAndGetterBean.class;
    BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
    PropertyDescriptor pd = null;
    PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors();
    for (int i = 0; i < pds.length; i++) {
        pd = pds[i];
        if (pd.getName().equals("data")) {
            break;
        }
    }
    assertNotNull(pd);
    assertTrue(pd instanceof IndexedPropertyDescriptor);
    IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
    assertNull(ipd.getReadMethod());
    assertNull(ipd.getWriteMethod());
    Method indexedReadMethod = beanClass.getMethod("getData", new Class[] { int.class });
    Method indexedWriteMethod = beanClass.getMethod("setData", new Class[] { int.class, int.class });
    assertEquals(indexedReadMethod, ipd.getIndexedReadMethod());
    assertEquals(indexedWriteMethod, ipd.getIndexedWriteMethod());
}
Also used : IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) PropertyDescriptor(java.beans.PropertyDescriptor) BeanInfo(java.beans.BeanInfo) SimpleBeanInfo(java.beans.SimpleBeanInfo) FakeFox01BeanInfo(org.apache.harmony.beans.tests.support.mock.FakeFox01BeanInfo) IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) Method(java.lang.reflect.Method)

Example 20 with IndexedPropertyDescriptor

use of java.beans.IndexedPropertyDescriptor in project j2objc by google.

the class IntrospectorTest method test_MixedSimpleClass27.

public void test_MixedSimpleClass27() throws Exception {
    BeanInfo info = Introspector.getBeanInfo(MixedSimpleClass27.class);
    Method indexedGetter = MixedSimpleClass27.class.getDeclaredMethod("getList", int.class);
    for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
        if (propertyName.equals(pd.getName())) {
            assertTrue(pd instanceof IndexedPropertyDescriptor);
            assertNull(pd.getReadMethod());
            assertNull(pd.getWriteMethod());
            assertEquals(indexedGetter, ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
            assertNull(((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
        }
    }
}
Also used : IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) PropertyDescriptor(java.beans.PropertyDescriptor) BeanInfo(java.beans.BeanInfo) SimpleBeanInfo(java.beans.SimpleBeanInfo) FakeFox01BeanInfo(org.apache.harmony.beans.tests.support.mock.FakeFox01BeanInfo) IndexedPropertyDescriptor(java.beans.IndexedPropertyDescriptor) Method(java.lang.reflect.Method)

Aggregations

IndexedPropertyDescriptor (java.beans.IndexedPropertyDescriptor)201 Method (java.lang.reflect.Method)171 PropertyDescriptor (java.beans.PropertyDescriptor)144 BeanInfo (java.beans.BeanInfo)127 SimpleBeanInfo (java.beans.SimpleBeanInfo)126 FakeFox01BeanInfo (org.apache.harmony.beans.tests.support.mock.FakeFox01BeanInfo)126 MockJavaBean (org.apache.harmony.beans.tests.support.mock.MockJavaBean)49 IntrospectionException (java.beans.IntrospectionException)21 EventSetDescriptor (java.beans.EventSetDescriptor)3 MethodDescriptor (java.beans.MethodDescriptor)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)2 Map (java.util.Map)2 PropertyInfo (cern.gp.beans.PropertyInfo)1 CachingStrategy (cern.gp.nodes.cache.CachingStrategy)1 NoCachingStrategy (cern.gp.nodes.cache.NoCachingStrategy)1 StickyCachingStrategy (cern.gp.nodes.cache.StickyCachingStrategy)1 TimeLimitedCachingStrategy (cern.gp.nodes.cache.TimeLimitedCachingStrategy)1 BugException (freemarker.core.BugException)1 KeyEvent (java.awt.event.KeyEvent)1