calc Setter Name for reflection - Java Reflection

Java examples for Reflection:Java Bean

Description

calc Setter Name for reflection

Demo Code


//package com.java2s;

public class Main {


    public static String calcSetterName(String fieldName) {
        return "set" + ucfirst(fieldName);
    }//  w  ww . j  a  v  a  2 s . c  om

    public static String ucfirst(String str) {
        return Character.toUpperCase(str.charAt(0)) + str.substring(1);
    }
}

Related Tutorials