Here you can find the source of toJava(String name)
public static String toJava(String name)
//package com.java2s; //License from project: Open Source License public class Main { public static String toJava(String name) { String out = ""; boolean nextUpper = false; for (int i = 0; i < name.length(); i++) { char next = name.charAt(i); if (next == '-') { nextUpper = true;/*from w w w .j av a 2 s.c o m*/ } else { if (nextUpper) { next = Character.toUpperCase(next); } out += next; nextUpper = false; } } return out; } }