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