public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { return new DirectGetter( getField(theClass, propertyName), theClass, propertyName ); }
public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { return new DirectGetter( getField(theClass, propertyName), theClass, propertyName ); }
public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException { return new DirectSetter( getField(theClass, propertyName), theClass, propertyName ); }
public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException { return new DirectSetter( getField(theClass, propertyName), theClass, propertyName ); }
public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException { return new DirectSetter( getField(theClass, propertyName), theClass, propertyName ); }
public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { return new DirectGetter( getField(theClass, propertyName), theClass, propertyName ); }
private static Field getField(Class clazz, String name) throws PropertyNotFoundException { if ( clazz==null || clazz==Object.class ) { throw new PropertyNotFoundException("field not found: " + name); } Field field; try { field = clazz.getDeclaredField(name); } catch (NoSuchFieldException nsfe) { field = getField( clazz, clazz.getSuperclass(), name ); } if ( !ReflectHelper.isPublic(clazz, field) ) field.setAccessible(true); return field; }
private static Field getField(Class root, Class clazz, String name) throws PropertyNotFoundException { if ( clazz==null || clazz==Object.class ) { throw new PropertyNotFoundException("field [" + name + "] not found on " + root.getName()); } Field field; try { field = clazz.getDeclaredField(name); } catch (NoSuchFieldException nsfe) { field = getField( root, clazz.getSuperclass(), name ); } if ( !ReflectHelper.isPublic(clazz, field) ) field.setAccessible(true); return field; }
private static Field getField(Class root, Class clazz, String name) throws PropertyNotFoundException { if ( clazz==null || clazz==Object.class ) { throw new PropertyNotFoundException("field [" + name + "] not found on " + root.getName()); } Field field; try { field = clazz.getDeclaredField(name); } catch (NoSuchFieldException nsfe) { field = getField( root, clazz.getSuperclass(), name ); } if ( !ReflectHelper.isPublic(clazz, field) ) field.setAccessible(true); return field; }
private static Field getField(Class clazz, String name) throws PropertyNotFoundException { if ( clazz==null || clazz==Object.class ) { throw new PropertyNotFoundException("field not found: " + name); // TODO: we should report what class we started searching for the property - right now it will always end on Object.class. } Field field; try { field = clazz.getDeclaredField(name); } catch (NoSuchFieldException nsfe) { field = getField( clazz.getSuperclass(), name ); } if ( !ReflectHelper.isPublic(clazz, field) ) field.setAccessible(true); return field; }
private static Field getField(Class root, Class clazz, String name) throws PropertyNotFoundException { if ( clazz==null || clazz==Object.class ) { throw new PropertyNotFoundException("field [" + name + "] not found on " + root.getName()); } Field field; try { field = clazz.getDeclaredField(name); } catch (NoSuchFieldException nsfe) { field = getField( root, clazz.getSuperclass(), name ); } if ( !ReflectHelper.isPublic(clazz, field) ) field.setAccessible(true); return field; }
private static Field getField(Class clazz, String name) throws PropertyNotFoundException { if ( clazz==null || clazz==Object.class ) { throw new PropertyNotFoundException("field not found: " + name); } Field field; try { field = clazz.getDeclaredField(name); } catch (NoSuchFieldException nsfe) { field = getField( clazz, clazz.getSuperclass(), name ); } if ( !ReflectHelper.isPublic(clazz, field) ) field.setAccessible(true); return field; }