public static String getPackageName ( Elements elementUtils , TypeElement type ) throws IOException { PackageElement pkg = elementUtils . getPackageOf ( type ) ; if ( ! pkg . isUnnamed ( ) ) { return pkg . getQualifiedName ( ) . toString ( ) ; } else { return "" ; // Default package } }
Get the Package name