Here you can find the source of shorten(String clazz)
Parameter | Description |
---|---|
clazz | A class name (with possible package and trailing semicolon) |
private static String shorten(String clazz)
//package com.java2s; /*/*from ww w. ja v a2 s . c o m*/ * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ public class Main { /** * @param clazz A class name (with possible package and trailing semicolon) * @return The short name for the class */ private static String shorten(String clazz) { if (null != clazz && clazz.endsWith(";")) { clazz = clazz.substring(0, clazz.length() - 1); } if (null != clazz && clazz.lastIndexOf(".") > -1) { clazz = clazz.substring(clazz.lastIndexOf(".") + 1, clazz.length()); } return clazz; } }