Java Java String Format toJavaIdentifier(String nodeName, boolean boundary)

Here you can find the source of toJavaIdentifier(String nodeName, boolean boundary)

Description

to Java Identifier

License

Apache License

Declaration

public static String toJavaIdentifier(String nodeName, boolean boundary) 

Method Source Code

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

Related

  1. toJavaEnum(String inStr)
  2. toJavaHex(byte in[], int len)
  3. toJavaHexCharString(final char chr)
  4. toJavaIdentifier(String name)
  5. toJavaIdentifier(String name)
  6. toJavaIdentifier(String s)
  7. toJavaIdentifier(String source)
  8. toJavaIdentifier(String str)
  9. toJavaIdentifier(String str)