Java Reflection Field Value Set setFieldValue(Object obj, Field field, Object value)

Here you can find the source of setFieldValue(Object obj, Field field, Object value)

Description

set Field Value

License

Apache License

Declaration

public static void setFieldValue(Object obj, Field field, Object value)
            throws IllegalArgumentException, IllegalAccessException 

Method Source Code

//package com.java2s;
//   Licensed under the Apache License, Version 2.0 (the "License");

import java.lang.reflect.Field;

public class Main {
    public static void setFieldValue(Object obj, Field field, Object value)
            throws IllegalArgumentException, IllegalAccessException {
        field.setAccessible(true);//from  www. j  a  v  a 2  s .  co m
        field.set(obj, value);
    }
}

Related

  1. setFieldValue(Object instance, Field field, Object value)
  2. setFieldValue(Object instanceContainingField, String fieldName, Object fieldValue)
  3. setFieldValue(Object o, Class baseClass, Class fieldType, T value)
  4. SetFieldValue(Object o, String field, Object object)
  5. setFieldValue(Object obj, Field f, Object value)
  6. setFieldValue(Object obj, Field field, Object value)
  7. setFieldValue(Object obj, String field, Object value)
  8. setFieldValue(Object obj, String fieldName, Object value)
  9. setFieldValue(Object obj, String fieldname, Object value)