public static Field find(final Class type, final String name) { try { final Field result = type.getDeclaredField(name); if (!result.isAccessible()) { result.setAccessible(true); } return result; } catch (final SecurityException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoSuchFieldException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot access field", type, name, e); } }
public static void write(final Field field, final Object instance, final Object value) { try { field.set(instance, value); } catch (final SecurityException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } }
public static Object read(final Field field, final Object instance) { try { return field.get(instance); } catch (final SecurityException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } }
public static Field find(final Class<?> type, final String name) { try { final Field result = type.getDeclaredField(name); if (!result.isAccessible()) { result.setAccessible(true); } return result; } catch (final SecurityException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoSuchFieldException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot access field", type, name, e); } }
public static Field find(final Class type, final String name) { try { final Field result = type.getDeclaredField(name); if (!result.isAccessible()) { result.setAccessible(true); } return result; } catch (final SecurityException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoSuchFieldException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot access field", type, name, e); } }
public static Field find(final Class type, final String name) { try { final Field result = type.getDeclaredField(name); if (!result.isAccessible()) { result.setAccessible(true); } return result; } catch (final SecurityException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoSuchFieldException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot access field", type, name, e); } }
public static void write(final Field field, final Object instance, final Object value) { try { field.set(instance, value); } catch (final SecurityException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } }
public static Field find(final Class type, final String name) { try { final Field result = type.getDeclaredField(name); if (!result.isAccessible()) { result.setAccessible(true); } return result; } catch (final SecurityException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoSuchFieldException e) { throw wrap("Cannot access field", type, name, e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot access field", type, name, e); } }
public static Object read(final Field field, final Object instance) { try { return field.get(instance); } catch (final SecurityException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } }
public static void write(final Field field, final Object instance, final Object value) { try { field.set(instance, value); } catch (final SecurityException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } }
public static Object read(final Field field, final Object instance) { try { return field.get(instance); } catch (final SecurityException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } }
public static Object read(final Field field, final Object instance) { try { return field.get(instance); } catch (final SecurityException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } }
public static void write(final Field field, final Object instance, final Object value) { try { field.set(instance, value); } catch (final SecurityException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } }
public static Object read(final Field field, final Object instance) { try { return field.get(instance); } catch (final SecurityException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot read field", field.getType(), field.getName(), e); } }
public static void write(final Field field, final Object instance, final Object value) { try { field.set(instance, value); } catch (final SecurityException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalArgumentException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final IllegalAccessException e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } catch (final NoClassDefFoundError e) { throw wrap("Cannot write field", field.getType(), field.getName(), e); } }