List of utility methods to do Class Name Extract
String | extractClassNameWithoutPackage(String className) Removes the package section from a fully qualified class name. int dotPos = className.lastIndexOf("."); if (dotPos != -1) { className = className.substring(dotPos + 1); int dollarPos = className.lastIndexOf("$"); if (dollarPos != -1) { className = className.substring(dollarPos + 1); return className; |
String | extractClassNameWithParent(String fullClassName) Class name with the parent if one exists. String[] splitName = fullClassName.split("\\."); return splitName[Math.max(splitName.length - 1, 0)]; |