public static java.lang.String | getNQClassName(java.lang.Class clazz)Get non qualified name for the specified class. For example, if this
method is passed a parameter representing Class java.lang.Integer, the
method will return the string "Integer". If the method is passed a
a parameter representing MyFirstJavaClass in default package then it
will return the string "MyFirstJavaClass".
String nqClassName = null;
String fqClassName = clazz.getName();
if (clazz.getPackage() != null) {
String pkgName = clazz.getPackage().getName();
nqClassName = fqClassName.substring(pkgName.length() + 1);
} else {
nqClassName = fqClassName;
}
return nqClassName;
|