Here you can find the source of extractClassNameWithoutPackage(String className)
public static String extractClassNameWithoutPackage(String className)
//package com.java2s; /*//from w w w .j ava 2 s . c om * Generator Runtime Servlet Framework * Copyright (C) 2004 Rick Knowles * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License * Version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License Version 2 for more details. * * You should have received a copy of the GNU Library General Public License * Version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ public class Main { /** * Removes the package section from a fully qualified class name. */ public static String extractClassNameWithoutPackage(String className) { int dotPos = className.lastIndexOf("."); if (dotPos != -1) { className = className.substring(dotPos + 1); } int dollarPos = className.lastIndexOf("$"); if (dollarPos != -1) { className = className.substring(dollarPos + 1); } return className; } }