Java Class Simple Name Get simpleName(Object obj)

Here you can find the source of simpleName(Object obj)

Description

simple Name

License

Open Source License

Declaration

public static String simpleName(Object obj) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String simpleName(Object obj) {
        return getClass(obj).getSimpleName();
    }//from   w ww.j  av  a  2s  .co  m

    public static String simpleName(Class clazz) {
        return getClass(clazz).getSimpleName();
    }

    public static Class getClass(Class clazz) {
        while (clazz.isAnonymousClass())
            clazz = clazz.getSuperclass();
        return clazz;
    }

    public static Class getClass(Object obj) {
        return getClass(obj.getClass());
    }
}

Related

  1. simpleName(Class c)
  2. simpleName(final Class className)
  3. simpleName(final String fqn)
  4. simpleName(final String fullyQualifiedClassName)
  5. simpleName(final String name)
  6. simpleName(String className)
  7. simpleName(String componentName)
  8. simpleName(String qualifiedClassName)
  9. simpleName(String qualifiedName)