Here you can find the source of simpleClassNameOf(Class> c)
Parameter | Description |
---|---|
The | class. |
public static String simpleClassNameOf(Class<?> c)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w . ja v a2 s .co m * Since Class.getSimpleName() method is not supported by GWT JRE. This method is to retrieve the simple name of the * class, which the last token of the full class name separated by dot. * * @param The * class. * @return */ public static String simpleClassNameOf(Class<?> c) { String cname = c.getName(); return cname.substring(cname.lastIndexOf('.') + 1); } public static String simpleClassNameOf(Object o) { return simpleClassNameOf(o.getClass()); } }