Here you can find the source of className(Object o)
public static String className(Object o)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/* w ww. j av a2s . com*/ * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ public class Main { public static String className(Object o) { if (o == null) { return ""; } String s = o.getClass().getName(); int i = s.lastIndexOf('.'); if (i >= 0) { return s.substring(i + 1); } else { return s; } } public static String substring(String s, int start) { if (s == null || start >= s.length()) { return ""; } return s.substring(start); } public static String substring(String s, int start, int len) { if (s == null || start >= s.length()) { return ""; } len = Math.min(s.length() - start, len); return s.substring(start, start + len); } public static int length(String s) { if (s == null) { return 0; } else { return s.length(); } } }