Java Class Name Get className(String nodeName)

Here you can find the source of className(String nodeName)

Description

class Name

License

Apache License

Declaration

public static String className(String nodeName) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String className(String nodeName) {
        return toJavaIdentifier(nodeName, true);
    }/*  w ww. j  a v  a2 s . c om*/

    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();
    }
}

Related

  1. className(Object object)
  2. className(Object value)
  3. className(String classFile, String pre)
  4. className(String classFullName)
  5. className(String fullyQualifiedName)
  6. className(String path)
  7. className(String underScore)
  8. classNames(String description)
  9. classNameSubName(String className)