use of java.beans.IndexedPropertyDescriptor in project j2objc by google.
the class IntrospectorTest method test_MixedSimpleClass8.
public void test_MixedSimpleClass8() throws Exception {
BeanInfo info = Introspector.getBeanInfo(MixedSimpleClass8.class);
Method setter = MixedSimpleClass8.class.getDeclaredMethod("setList", Object.class);
for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
if (propertyName.equals(pd.getName())) {
assertFalse(pd instanceof IndexedPropertyDescriptor);
assertNull(pd.getReadMethod());
assertEquals(setter, pd.getWriteMethod());
}
}
}
use of java.beans.IndexedPropertyDescriptor in project j2objc by google.
the class IntrospectorTest method test_MixedSimpleClass14.
public void test_MixedSimpleClass14() throws Exception {
BeanInfo info = Introspector.getBeanInfo(MixedSimpleClass14.class);
Method getter = MixedSimpleClass14.class.getDeclaredMethod("getList", int.class);
Method setter = MixedSimpleClass14.class.getDeclaredMethod("setList", int.class, Object.class);
for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
if (propertyName.equals(pd.getName())) {
assertTrue(pd instanceof IndexedPropertyDescriptor);
assertNull(pd.getReadMethod());
assertNull(pd.getWriteMethod());
assertEquals(getter, ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
assertEquals(setter, ((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
}
}
}
use of java.beans.IndexedPropertyDescriptor in project j2objc by google.
the class IntrospectorTest method test_MixedBooleanSimpleClass16.
public void test_MixedBooleanSimpleClass16() throws Exception {
BeanInfo info = Introspector.getBeanInfo(MixedBooleanSimpleClass16.class);
Method getter = MixedBooleanSimpleClass16.class.getDeclaredMethod("getList", int.class);
Method setter = MixedBooleanSimpleClass16.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());
assertEquals(getter, ((IndexedPropertyDescriptor) pd).getIndexedReadMethod());
assertEquals(setter, ((IndexedPropertyDescriptor) pd).getIndexedWriteMethod());
}
}
}
use of java.beans.IndexedPropertyDescriptor in project j2objc by google.
the class IntrospectorTest method test_MixedBooleanSimpleClass40.
public void test_MixedBooleanSimpleClass40() throws Exception {
BeanInfo info = Introspector.getBeanInfo(MixedBooleanSimpleClass40.class);
Method setter = MixedBooleanSimpleClass40.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;
}
}
}
use of java.beans.IndexedPropertyDescriptor in project spring-framework by spring-projects.
the class ExtendedBeanInfo method findExistingPropertyDescriptor.
private PropertyDescriptor findExistingPropertyDescriptor(String propertyName, Class<?> propertyType) {
for (PropertyDescriptor pd : this.propertyDescriptors) {
final Class<?> candidateType;
final String candidateName = pd.getName();
if (pd instanceof IndexedPropertyDescriptor) {
IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
candidateType = ipd.getIndexedPropertyType();
if (candidateName.equals(propertyName) && (candidateType.equals(propertyType) || candidateType.equals(propertyType.getComponentType()))) {
return pd;
}
} else {
candidateType = pd.getPropertyType();
if (candidateName.equals(propertyName) && (candidateType.equals(propertyType) || propertyType.equals(candidateType.getComponentType()))) {
return pd;
}
}
}
return null;
}
Aggregations