Here you can find the source of toSetterName(String name)
public static String toSetterName(String name)
//package com.java2s; //License from project: BSD License public class Main { public static String toSetterName(String name) { return tohPrefixialCamelName(name, "set"); }//from ww w . j ava 2 s. co m public static String tohPrefixialCamelName(String name, String prefix) { if (name == null || name.length() == 0) { return ""; } StringBuffer buffer = new StringBuffer(); String camelName = toCamelName(name); return buffer.append(prefix).append(camelName).toString(); } public static String toCamelName(String name) { if (name == null || name.length() == 0) { return ""; } char firstChar = name.charAt(0); if (!Character.isLetter(firstChar)) { return name; } char upperChar = Character.toUpperCase(firstChar); StringBuffer buffer = new StringBuffer(); return buffer.append(upperChar).append(name.substring(1, name.length())).toString(); } }