List parsedName = parseName(name, '_'); StringBuffer result = new StringBuffer(); for (Iterator i = parsedName.iterator(); i.hasNext(); ) { String nameComponent = (String)i.next(); if (nameComponent.length() > 0) { if (result.length() > 0 || isUpperCase) { result.append(Character.toUpperCase(nameComponent.charAt(0))); result.append(nameComponent.substring(1)); } else { result.append(nameComponent); } } }  return result.length() == 0 ? "_" : Character.isJavaIdentifierStart(result.charAt(0)) ? isUpperCase ? result.toString() : uncapName(result.toString()) : "_" + result;
return validName(name, isUpperCase, "_");
  protected String validName(String name, boolean isUpperCase)  {    List parsedName = parseName(name, '_');    StringBuffer result = new StringBuffer();    for (Iterator i = parsedName.iterator(); i.hasNext(); )    {      String nameComponent = (String)i.next();      if (nameComponent.length() > 0)      {        if (result.length() > 0 || isUpperCase)        {          result.append(Character.toUpperCase(nameComponent.charAt(0)));          result.append(nameComponent.substring(1));        }        else        {          result.append(nameComponent);        }      }    }    return      result.length() == 0 ?        "_" :        Character.isJavaIdentifierStart(result.charAt(0)) ?          isUpperCase ?            result.toString() :            uncapName(result.toString()) :          "_" + result;  }