List of utility methods to do Class Simple Name Get
String | simpleName(final String name) Return a lower case, non-spaced version of the specified name. final int len = name.length(); final StringBuffer sb = new StringBuffer(len); for (int pos = 0; pos < len; pos++) { final char ch = name.charAt(pos); if (ch == ' ') { continue; sb.append(Character.toLowerCase(ch)); ... |
String | simpleName(Object obj) simple Name return getClass(obj).getSimpleName();
|
String | simpleName(String className) simple Name String[] parts = className.split("\\."); if (parts.length == 0) { return null; return parts[parts.length - 1]; |
String | simpleName(String componentName) Extracts the component simple name from the fully qualified component name. int p = componentName.lastIndexOf('/'); if (p >= 0) { return componentName.substring(p + 1); return null; |
String | simpleName(String qualifiedClassName) simple Name String packageName = packageName(qualifiedClassName);
return packageName.isEmpty() ? qualifiedClassName : qualifiedClassName.substring(packageName.length() + 1);
|
String | simpleName(String qualifiedName) simple Name return qualifiedName.substring( qualifiedName.lastIndexOf('.') != -1 ? qualifiedName.lastIndexOf('.') + 1 : 0, qualifiedName.length()); |
String | simpleName(String type) simple Name int ix = type.lastIndexOf('.'); if (ix == -1) { return type; return type.substring(ix + 1); |
String | simpleNameFromQualifiedName(String qualifiedName) simple Name From Qualified Name int lastPeriodIndex = qualifiedName.lastIndexOf('.'); if (lastPeriodIndex == -1) return qualifiedName; else return qualifiedName.substring(lastPeriodIndex + 1); |
String | simpleNameOf(String s) Returns the simple class name once package is strip package. if (s.contains(".")) { return s.substring(s.lastIndexOf('.') + 1); } else { return s; |
String | simpleNameWithoutEnhance(Class> clazz) simple Name Without Enhance String simpleName = clazz.getSimpleName(); if (simpleName.contains("$$Enhancer")) { simpleName = simpleName.substring(0, simpleName.indexOf("$$Enhancer")); return simpleName; |