List of utility methods to do ID Value Create
String | toId(String text) to Id return text.replaceAll("[^a-zA-Z0-9\\-_]*", ""); |
String | toIdableName(String xpath) to Idable Name xpath = "X" + xpath; xpath = xpath.replace("/", "-"); xpath = xpath.replace("[", "_"); return xpath.replace("]", ":"); |
String | toIdentifier(String input) Modifies all characters which are not valid in an identifier; leading and trailing blanks are removed. final String ti = input.trim(); if (ti.isEmpty() == true) { return ti; final StringBuilder sb = new StringBuilder(ti); char c = sb.charAt(0); if (Character.isJavaIdentifierStart(c) == false || c == '$') { sb.setCharAt(0, '_'); ... |
String | toIdentifier(String name) convert a name to Java-compatible identifier name. return xmlNameToJavaName("field", name); |
void | toIdentifier(String name, StringBuffer fieldName) to Identifier for (int i = 0; i < name.length(); i++) { if (name.charAt(i) == ' ') fieldName.append(Character.toUpperCase(name.charAt(++i))); else fieldName.append(name.charAt(i)); |
String | toIdentifier(String str) Given a string, returns a proper C identifier. StringBuffer buf = new StringBuffer(); if (!str.isEmpty()) { char first = str.charAt(0); if (Character.isJavaIdentifierPart(first) && !Character.isJavaIdentifierStart(first)) { buf.append("_"); for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); ... |
String | toIdentifier(String text) to Identifier String out = ""; if (Character.isDigit(text.charAt(0))) out += "_"; for (int i = 0; i < text.length(); i++) { if (Character.isJavaIdentifierPart(text.charAt(i))) out += text.charAt(i); else if (text.charAt(i) == ' ') out += "_"; ... |
String | toIdentifierString(long val) creates a shortest possible string representation of the given long number that qualifies as an identifier in common programming languages (and HTML-id's :-) That is, it must start with a letter. char buf[] = new char[14]; int i = 0; if (val < 0) { buf[i++] = '_'; val = -(val + 1); buf[i++] = ALPHAS[(int) (val % ALPHAS.length)]; val /= ALPHAS.length; ... |
String | toIdentityEncodedString(byte[] data) to Identity Encoded String if (data == null) { return null; char[] characters = new char[data.length]; for (int i = 0; i < characters.length; i++) { characters[i] = (char) (data[i] & 0xff); return new String(characters); ... |
Integer | toIdentityHashCodeInteger(Object value) to Identity Hash Code Integer return new Integer(System.identityHashCode(value)); |