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
    }
  }
public static String getPackageName(Elements elementUtils, TypeElement type) throws IOException {
    PackageElement pkg = elementUtils.getPackageOf(type);
    if (!pkg.isUnnamed()) {
      return pkg.getQualifiedName().toString();
    } else {
      return ""; 
    }
  }
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

@throws IOException
Get the Package name