Java examples for Reflection:Setter
get Setter Method Name For Field
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { String fieldName = "java2s.com"; System.out.println(getSetterMethodNameForField(fieldName)); }// ww w .ja v a 2 s. c om public static String getSetterMethodNameForField(String fieldName) { return "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1); } }