@Test public void shouldResolveArraySetterParam() throws Exception { ReflectorFactory reflectorFactory = new DefaultReflectorFactory(); Reflector reflector = reflectorFactory.findForClass(Child.class); Class<?> clazz = reflector.getSetterType("array"); assertTrue(clazz.isArray()); assertEquals(String.class, clazz.getComponentType()); }
public Class<?> getSetterType(String propertyName) { Class<?> clazz = setTypes.get(propertyName); if (clazz == null) { throw new ReflectionException("There is no setter for property named '" + propertyName + "' in '" + type + "'"); } return clazz; }
Reflector { public Class<?> getSetterType(String propertyName) { Class<?> clazz = setTypes.get(propertyName); if (clazz == null) { throw new ReflectionException("There is no setter for property named '" + propertyName + "' in '" + type + "'"); } return clazz; } }
Reflector { public Class<?> getSetterType(String propertyName) { Class<?> clazz = setTypes.get(propertyName); if (clazz == null) { throw new ReflectionException("There is no setter for property named '" + propertyName + "' in '" + type + "'"); } return clazz; } Reflector(Class<?> clazz); }
Reflector { public Class<?> getSetterType(String propertyName) { Class<?> clazz = setTypes.get(propertyName); if (clazz == null) { throw new ReflectionException("There is no setter for property named '" + propertyName + "' in '" + type + "'"); } return clazz; } Reflector(Class<?> clazz); static boolean canControlMemberAccessible(); Class<?> getType(); Constructor<?> getDefaultConstructor(); boolean hasDefaultConstructor(); Invoker getSetInvoker(String propertyName); Invoker getGetInvoker(String propertyName); Class<?> getSetterType(String propertyName); Class<?> getGetterType(String propertyName); String[] getGetablePropertyNames(); String[] getSetablePropertyNames(); boolean hasSetter(String propertyName); boolean hasGetter(String propertyName); String findPropertyName(String name); }
Reflector { public Class<?> getSetterType(String propertyName) { Class<?> clazz = setTypes.get(propertyName); if (clazz == null) { throw new ReflectionException("There is no setter for property named '" + propertyName + "' in '" + type + "'"); } return clazz; } Reflector(Class<?> clazz); static boolean canControlMemberAccessible(); Class<?> getType(); Constructor<?> getDefaultConstructor(); boolean hasDefaultConstructor(); Invoker getSetInvoker(String propertyName); Invoker getGetInvoker(String propertyName); Class<?> getSetterType(String propertyName); Class<?> getGetterType(String propertyName); String[] getGetablePropertyNames(); String[] getSetablePropertyNames(); boolean hasSetter(String propertyName); boolean hasGetter(String propertyName); String findPropertyName(String name);  }