org.eclipse.oomph.util

## Class ReflectUtil

- java.lang.Object
- - org.eclipse.oomph.util.ReflectUtil

-     public final class ReflectUtil
      extends Object

  Various static helper methods for dealing with Java reflection.
  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ReflectUtil.ReflectionException`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> Constructor<T>` | `getConstructor(Class<T> c, Class<?>... parameterTypes)`
    `static Field` | `getField(Class<?> c, String fieldName)`
    `static Method` | `getMethod(Class<?> c, String methodName, Class<?>... parameterTypes)`
    `static Object` | `getValue(Field field, Object target)`
    `static Object` | `getValue(String fieldName, Object target)`
    `static Object` | `invokeMethod(Method method, Object target, Object... arguments)`
    `static <T> T` | `newInstance(Constructor<T> constructor, Object... arguments)`
    `static void` | `setValue(Field field, Object target, Object value)`
    `static void` | `setValue(Field field, Object target, Object value, boolean force)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getConstructor

          public static <T> Constructor<T> getConstructor(Class<T> c,
                                          Class<?>... parameterTypes)

    - #### newInstance

          public static <T> T newInstance(Constructor<T> constructor,
                          Object... arguments)

    - #### getMethod

          public static Method getMethod(Class<?> c,
                         String methodName,
                         Class<?>... parameterTypes)

    - #### invokeMethod

          public static Object invokeMethod(Method method,
                            Object target,
                            Object... arguments)

    - #### getField

          public static Field getField(Class<?> c,
                       String fieldName)

    - #### getValue

          public static Object getValue(Field field,
                        Object target)

    - #### getValue

          public static Object getValue(String fieldName,
                        Object target)

    - #### setValue

          public static void setValue(Field field,
                      Object target,
                      Object value)

    - #### setValue

          public static void setValue(Field field,
                      Object target,
                      Object value,
                      boolean force)

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html