Generate package statement after the SWIG banner

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5738 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-02-24 21:03:47 +00:00
commit e1d89a2cdc

View file

@ -56,7 +56,7 @@ class JAVA : public Language {
String *variable_name; //Name of a variable being wrapped String *variable_name; //Name of a variable being wrapped
String *proxy_class_constants_code; String *proxy_class_constants_code;
String *module_class_constants_code; String *module_class_constants_code;
String *package; // Package name String *package; // Optional package name
String *jnipackage; // Package name used in the JNI code String *jnipackage; // Package name used in the JNI code
String *package_path; // Package name used internally by JNI (slashes) String *package_path; // Package name used internally by JNI (slashes)
String *imclass_imports; //intermediary class imports from %pragma String *imclass_imports; //intermediary class imports from %pragma
@ -413,11 +413,12 @@ class JAVA : public Language {
} }
Delete(filen); filen = NULL; Delete(filen); filen = NULL;
// Start writing out the intermediary class // Start writing out the intermediary class file
if(Len(package) > 0)
Printf(f_im, "package %s;\n\n", package);
emitBanner(f_im); emitBanner(f_im);
if(Len(package) > 0)
Printf(f_im, "package %s;\n", package);
if(imclass_imports) if(imclass_imports)
Printf(f_im, "%s\n", imclass_imports); Printf(f_im, "%s\n", imclass_imports);
@ -462,11 +463,12 @@ class JAVA : public Language {
} }
Delete(filen); filen = NULL; Delete(filen); filen = NULL;
// Start writing out the module class // Start writing out the module class file
if(Len(package) > 0)
Printf(f_module, "package %s;\n\n", package);
emitBanner(f_module); emitBanner(f_module);
if(Len(package) > 0)
Printf(f_module, "package %s;\n", package);
if(module_imports) if(module_imports)
Printf(f_module, "%s\n", module_imports); Printf(f_module, "%s\n", module_imports);
@ -505,11 +507,12 @@ class JAVA : public Language {
} }
Delete(filen); filen = NULL; Delete(filen); filen = NULL;
// Start writing out the Java constants interface // Start writing out the Java constants interface file
if(Len(package) > 0)
Printf(f_module, "package %s;\n\n", package);
emitBanner(f_module); emitBanner(f_module);
if(Len(package) > 0)
Printf(f_module, "package %s;\n", package);
if(module_imports) if(module_imports)
Printf(f_module, "%s\n", module_imports); Printf(f_module, "%s\n", module_imports);
@ -1464,10 +1467,11 @@ class JAVA : public Language {
} }
Delete(filen); filen = NULL; Delete(filen); filen = NULL;
// Start writing out the proxy class file
emitBanner(f_proxy); emitBanner(f_proxy);
if(Len(package) > 0) if(Len(package) > 0)
Printf(f_proxy, "package %s;\n\n", package); Printf(f_proxy, "package %s;\n", package);
Clear(proxy_class_def); Clear(proxy_class_def);
Clear(proxy_class_code); Clear(proxy_class_code);
@ -2183,10 +2187,11 @@ class JAVA : public Language {
} }
Delete(filen); filen = NULL; Delete(filen); filen = NULL;
// Emit banner and package name // Start writing out the type wrapper class file
emitBanner(f_swigtype); emitBanner(f_swigtype);
if(Len(package) > 0) if(Len(package) > 0)
Printf(f_swigtype, "package %s;\n\n", package); Printf(f_swigtype, "package %s;\n", package);
// Pure Java baseclass and interfaces // Pure Java baseclass and interfaces
const String *pure_baseclass = typemapLookup("javabase", type, WARN_NONE); const String *pure_baseclass = typemapLookup("javabase", type, WARN_NONE);