public FieldAccessor(Class<?> objectClass, String propertyName, Class<?> propertyType) { // sanity check if (objectClass == null) { throw new IllegalArgumentException("Null objectClass"); } if (propertyName == null) { throw new IllegalArgumentException("Null propertyName"); } this.propertyName = propertyName; this.field = prepareField(objectClass, propertyName, propertyType); this.nullValue = PropertyUtils.defaultNullValueForType(field.getType()); }
this.nullValue = PropertyUtils.defaultNullValueForType(propertyType);