Here you can find the source of extractClassNameWithParent(String fullClassName)
Parameter | Description |
---|---|
fullClassName | class name including packages |
public static String extractClassNameWithParent(String fullClassName)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w .ja v a 2 s . com * Class name with the parent if one exists. This happens * when the class is an anonymous class. We want * class name:Parent$Child. * @param fullClassName class name including packages * @return name of class with parent separated with "$". */ public static String extractClassNameWithParent(String fullClassName) { String[] splitName = fullClassName.split("\\."); return splitName[Math.max(splitName.length - 1, 0)]; } }