/** * Returns a new field invoker. A field invoker is capable of accessing (read/write) the underlying field. * @param target the type containing the static field of interest. * @return the created field invoker. * @throws NullPointerException if the given target is <code>null</code>. * @throws ReflectionError if a static field with a matching name and type cannot be found. */ public Invoker<T> in(Class<?> target) { return newInvoker(name, type, target); } }
/** * Returns a new field invoker. A field invoker is capable of accessing (read/write) the underlying field. * @param target the type containing the static field of interest. * @return the created field invoker. * @throws NullPointerException if the given target is <code>null</code>. * @throws ReflectionError if a static field with a matching name and type cannot be found. */ public Invoker<T> in(Class<?> target) { return newInvoker(name, type, target); } }
/** * Returns a new field access invoker, capable of accessing (read/write) the underlying field. * @param target the object containing the field of interest. * @return the created field access invoker. * @throws NullPointerException if the given target is <code>null</code>. * @throws ReflectionError if a field with a matching name and type cannot be found. */ public Invoker<T> in(Object target) { Object nestedTarget = null; for (String fieldName : path) { nestedTarget = Invoker.getNestedField(fieldName, nestedTarget == null ? target : nestedTarget); } return newInvoker(name, type, nestedTarget == null ? target : nestedTarget); }
/** * Returns a new field invoker. A field invoker is capable of accessing (read/write) the underlying field. * @param target the object containing the field of interest. * @return the created field invoker. * @throws NullPointerException if the given target is <code>null</code>. * @throws ReflectionError if a field with a matching name and type cannot be found. */ public Invoker<T> in(Object target) { Object nestedTarget = null; for (String fieldName : path) { nestedTarget = Invoker.getNestedField(fieldName, nestedTarget == null ? target : nestedTarget); } return newInvoker(name, type, nestedTarget == null ? target : nestedTarget); } }