Java Class Simple Name Get simpleName(String componentName)

Here you can find the source of simpleName(String componentName)

Description

Extracts the component simple name from the fully qualified component name.

License

Apache License

Declaration

public static String simpleName(String componentName) 

Method Source Code

//package com.java2s;
/*//from  w  w w .j a v  a2  s.co m
 * z2env.org - (c) ZFabrik Software KG
 * 
 * Licensed under Apache 2.
 * 
 * www.z2-environment.net
 */

public class Main {
    /**
     * Extracts the component simple name from the fully qualified component
     * name. This is simply the part following the last "/".
     */
    public static String simpleName(String componentName) {
        int p = componentName.lastIndexOf('/');
        if (p >= 0) {
            return componentName.substring(p + 1);
        }
        return null;
    }
}

Related

  1. simpleName(final String fqn)
  2. simpleName(final String fullyQualifiedClassName)
  3. simpleName(final String name)
  4. simpleName(Object obj)
  5. simpleName(String className)
  6. simpleName(String qualifiedClassName)
  7. simpleName(String qualifiedName)
  8. simpleName(String type)
  9. simpleNameFromQualifiedName(String qualifiedName)