List of utility methods to do Class Simple Name Get
String | toSimpleName(Class> type) to Simple Name String name = type.getName().substring(type.getName().lastIndexOf(".") + 1); return name.replaceAll("\\$", "_"); |
String | toSimpleName(final String qualifiedName) to Simple Name final String[] tokens = qualifiedName.split("\\."); return tokens[tokens.length - 1]; |
String | toSimpleName(String className) to Simple Name if (className == null) { return null; if (className.startsWith("$$")) { className = className.substring("$$".length()); int indexOfDollarDollar = className.indexOf("$$", 1); if (indexOfDollarDollar < 0) { ... |
String | toSimpleName(String classPackageName) to Simple Name int lastIndexOf = classPackageName.lastIndexOf('.'); if (lastIndexOf >= 0) return classPackageName.substring(lastIndexOf + 1); return ""; |
String | toSimpleName(String fqn) to Simple Name int lastSeparatorPos = fqn.lastIndexOf(FQN_SEPARATOR); if (lastSeparatorPos == -1) return fqn; else return fqn.substring(lastSeparatorPos + 1); |
String | toSimpleName(String qname) to Simple Name int s = qname.lastIndexOf('.'); return (s == -1) ? qname : qname.substring(s + 1); |
String | ToSimpleName(String str) To Simple Name String[] strs = str.split("_"); String simpleName = strs[0]; if (strs.length > 1) { simpleName = str.replaceFirst(strs[0] + "_", ""); return simpleName; |