calc Getter Name for reflection - Java Reflection

Java examples for Reflection:Java Bean

Description

calc Getter Name for reflection

Demo Code


//package com.java2s;

public class Main {


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

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

Related Tutorials