get Setter Method For Field - Java Reflection

Java examples for Reflection:Setter

Description

get Setter Method For Field

Demo Code


//package com.java2s;

import java.lang.reflect.Method;

public class Main {

    public static Method getSetterMethodForField(Object obj,
            String fieldName, Class type) throws NoSuchMethodException {
        return obj.getClass().getDeclaredMethod(fieldName, type);
    }//from   w  w w  .ja v a  2s .c o  m
}

Related Tutorials