Here you can find the source of fieldName(String nodeName)
public static String fieldName(String nodeName)
//package com.java2s; //License from project: Apache License public class Main { public static String fieldName(String nodeName) { return toJavaIdentifier(nodeName, false); }//from w ww. jav a 2 s. c o m public static String toJavaIdentifier(String nodeName, boolean boundary) { StringBuilder result = new StringBuilder(); for (char c : nodeName.toCharArray()) { if (c == '_') { boundary = true; } else if (boundary) { result.append(c); boundary = false; } else { result.append(Character.toLowerCase(c)); } } return result.toString(); } }