FileDocCategorySizeDatePackage
Utils.javaAPI DocGlassfish v2 API2834Fri May 04 22:32:04 BST 2007com.sun.enterprise.pluggable

Utils

public class Utils extends Object
Common utility methods for this package.

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.StringgetNQClassName(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;