Returns the package name of {@code clazz} according to the Java Language Specification (section 6.7). Unlike {@link Class#getPackage}, this method only parses the class name, without attempting to define the {@link Package} and hence load files.
(Class<?> clazz)
| 33 | * attempting to define the {@link Package} and hence load files. |
| 34 | */ |
| 35 | public static String getPackageName(Class<?> clazz) { |
| 36 | return getPackageName(clazz.getName()); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Returns the package name of {@code classFullName} according to the Java Language Specification |