diff --git a/Examples/test-suite/doxygen_parsing.i b/Examples/test-suite/doxygen_parsing.i index 20781cfa8..b61317bcd 100644 --- a/Examples/test-suite/doxygen_parsing.i +++ b/Examples/test-suite/doxygen_parsing.i @@ -55,15 +55,6 @@ public: } }; -/** Test enumeration */ -enum E_TEST -{ - /** the first item */ - E_TEST_ONE, - E_TEST_TWO = 2, /**< the second */ - E_TEST_THREE = 2+1 -}; - /** * Comment for template class */ diff --git a/Examples/test-suite/doxygen_parsing_enums.i b/Examples/test-suite/doxygen_parsing_enums.i new file mode 100644 index 000000000..317abf384 --- /dev/null +++ b/Examples/test-suite/doxygen_parsing_enums.i @@ -0,0 +1,15 @@ +%module doxygen_parsing_enums + +%inline %{ + + +/** Test enumeration */ +enum E_TEST +{ + /** the first item */ + E_TEST_ONE, + E_TEST_TWO = 2, /**< the second */ + E_TEST_THREE = 2+1 +}; + +%} \ No newline at end of file diff --git a/Examples/test-suite/doxygen_parsing_enums_proper.i b/Examples/test-suite/doxygen_parsing_enums_proper.i new file mode 100644 index 000000000..1a69a84f1 --- /dev/null +++ b/Examples/test-suite/doxygen_parsing_enums_proper.i @@ -0,0 +1,7 @@ +%module "doxygen_parsing_enums_proper" + +// Test enum commenting using the proper enums in the target language +%include "enums.swg" + +%include "doxygen_parsing_enums.i" + diff --git a/Examples/test-suite/doxygen_parsing_enums_simple.i b/Examples/test-suite/doxygen_parsing_enums_simple.i new file mode 100644 index 000000000..823a27584 --- /dev/null +++ b/Examples/test-suite/doxygen_parsing_enums_simple.i @@ -0,0 +1,6 @@ +%module "doxygen_parsing_enums_simple" + +// Test enum commenting using simple constants (SWIG-1.3.21 and earlier default enum wrapping for C# and Java) +%include "enumsimple.swg" + +%include "doxygen_parsing_enums.i" \ No newline at end of file diff --git a/Examples/test-suite/doxygen_parsing_enums_typesafe.i b/Examples/test-suite/doxygen_parsing_enums_typesafe.i new file mode 100644 index 000000000..25e355ee2 --- /dev/null +++ b/Examples/test-suite/doxygen_parsing_enums_typesafe.i @@ -0,0 +1,8 @@ +%module "doxygen_parsing_enums_typesafe" + +// Test enum commenting using the typesafe enum pattern in the target language +%include "enumtypesafe.swg" + +#define SWIG_TEST_NOCSCONST // For C# typesafe enums + +%include "doxygen_parsing_enums.i" \ No newline at end of file diff --git a/Examples/test-suite/doxygen_parsing_enums_typeunsafe.i b/Examples/test-suite/doxygen_parsing_enums_typeunsafe.i new file mode 100644 index 000000000..e001035df --- /dev/null +++ b/Examples/test-suite/doxygen_parsing_enums_typeunsafe.i @@ -0,0 +1,6 @@ +%module "doxygen_parsing_enums_typeunsafe" + +// Test enum commenting using a type unsafe enum pattern (constant integers in a class for the enum type) +%include "enumtypeunsafe.swg" + +%include "doxygen_parsing_enums.i" \ No newline at end of file diff --git a/Examples/test-suite/java/Makefile.in b/Examples/test-suite/java/Makefile.in index 813232620..3cb9d0c23 100644 --- a/Examples/test-suite/java/Makefile.in +++ b/Examples/test-suite/java/Makefile.in @@ -16,6 +16,10 @@ C_TEST_CASES = \ java_lib_various CPP_TEST_CASES = \ + doxygen_parsing_enums_simple \ + doxygen_parsing_enums_proper \ + doxygen_parsing_enums_typesafe \ + doxygen_parsing_enums_typeunsafe \ enum_thorough_proper \ enum_thorough_simple \ enum_thorough_typeunsafe \ diff --git a/Examples/test-suite/java/doxygen_parsing_enums_proper_runme.java b/Examples/test-suite/java/doxygen_parsing_enums_proper_runme.java new file mode 100644 index 000000000..503e2c68e --- /dev/null +++ b/Examples/test-suite/java/doxygen_parsing_enums_proper_runme.java @@ -0,0 +1,93 @@ + +import doxygen_parsing_enums_proper.*; +import com.sun.javadoc.*; +import java.util.HashMap; +import java.util.Map.Entry; +import java.util.Iterator; + +public class doxygen_parsing_enums_proper_runme { + static { + try { + System.loadLibrary("doxygen_parsing_enums_proper"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); + System.exit(1); + } + } + + static HashMap parsedComments = new HashMap(); + static HashMap wantedComments = new HashMap(); + + public static boolean start(RootDoc root) { + + /* + This method is called by 'javadoc' and gets the whole parsed + java file, we get comments and store them + */ + + ClassDoc[] classes = root.classes(); + + for (int i = 0; i < classes.length; i++) { + + if (classes[i].getRawCommentText().length() > 0) + parsedComments.put(classes[i].name(), classes[i].getRawCommentText()); + + MethodDoc[] methods = classes[i].methods(); + FieldDoc[] fields = classes[i].fields(); + FieldDoc[] constants = classes[i].enumConstants(); + + for (int j = 0; j < constants.length; j++) { + FieldDoc f = constants[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } + for (int j = 0; j < fields.length; j++) { + FieldDoc f = fields[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } + for (int j = 0; j < methods.length; j++) { + MethodDoc m = methods[j]; + if (m.getRawCommentText().length() > 0) + parsedComments.put(m.name(), m.getRawCommentText()); + } + } + return true; + } + + public static void main(String argv[]) + { + /* + Here we are using internal javadoc tool, it accepts the name of the class as paramterer, + and calls the start() method of that class with parsed information. + */ + com.sun.tools.javadoc.Main.execute("doxygen_parsing_enums_proper runtime test", + "doxygen_parsing_enums_proper_runme", new String[]{"-quiet", "doxygen_parsing_enums_proper"}); + + wantedComments.put("E_TEST", " Test enumeration \n"); + wantedComments.put("E_TEST_ONE", " the first item \n"); + wantedComments.put("E_TEST_TWO", " the second \n"); + + int errorCount=0; + Iterator< Entry > it = parsedComments.entrySet().iterator(); + + while (it.hasNext()) + { + Entry e = (Entry) it.next(); + + if (!e.getValue().equals(wantedComments.get(e.getKey()))) { + System.out.println("Documentation comments for " + e.getKey() + " does not match: "); + System.out.println("\texpected:"+wantedComments.get(e.getKey())); + System.out.println("\tgot:\t"+e.getValue()); + errorCount++; + } + } + + if (parsedComments.size() != wantedComments.size()) { + System.out.println("Found " + (wantedComments.size()-parsedComments.size()) + " missed comment(s)!"); + errorCount++; + } + + System.exit(errorCount); + } +} diff --git a/Examples/test-suite/java/doxygen_parsing_enums_simple_runme.java b/Examples/test-suite/java/doxygen_parsing_enums_simple_runme.java new file mode 100644 index 000000000..ca640b3f0 --- /dev/null +++ b/Examples/test-suite/java/doxygen_parsing_enums_simple_runme.java @@ -0,0 +1,93 @@ + +import doxygen_parsing_enums_simple.*; +import com.sun.javadoc.*; +import java.util.HashMap; +import java.util.Map.Entry; +import java.util.Iterator; + +public class doxygen_parsing_enums_simple_runme { + static { + try { + System.loadLibrary("doxygen_parsing_enums_simple"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); + System.exit(1); + } + } + + static HashMap parsedComments = new HashMap(); + static HashMap wantedComments = new HashMap(); + + public static boolean start(RootDoc root) { + + /* + This method is called by 'javadoc' and gets the whole parsed + java file, we get comments and store them + */ + + ClassDoc[] classes = root.classes(); + + for (int i = 0; i < classes.length; i++) { + + if (classes[i].getRawCommentText().length() > 0) + parsedComments.put(classes[i].name(), classes[i].getRawCommentText()); + + MethodDoc[] methods = classes[i].methods(); + FieldDoc[] fields = classes[i].fields(); + FieldDoc[] constants = classes[i].enumConstants(); + + for (int j = 0; j < constants.length; j++) { + FieldDoc f = constants[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } + for (int j = 0; j < fields.length; j++) { + FieldDoc f = fields[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } + for (int j = 0; j < methods.length; j++) { + MethodDoc m = methods[j]; + if (m.getRawCommentText().length() > 0) + parsedComments.put(m.name(), m.getRawCommentText()); + } + } + return true; + } + + public static void main(String argv[]) + { + /* + Here we are using internal javadoc tool, it accepts the name of the class as paramterer, + and calls the start() method of that class with parsed information. + */ + com.sun.tools.javadoc.Main.execute("doxygen_parsing_enums_simple runtime test", + "doxygen_parsing_enums_simple_runme", new String[]{"-quiet", "doxygen_parsing_enums_simple"}); + + wantedComments.put("E_TEST", " Test enumeration \n"); + wantedComments.put("E_TEST_ONE", " the first item \n"); + wantedComments.put("E_TEST_TWO", " the second \n"); + + int errorCount=0; + Iterator< Entry > it = parsedComments.entrySet().iterator(); + + while (it.hasNext()) + { + Entry e = (Entry) it.next(); + + if (!e.getValue().equals(wantedComments.get(e.getKey()))) { + System.out.println("Documentation comments for " + e.getKey() + " does not match: "); + System.out.println("\texpected:"+wantedComments.get(e.getKey())); + System.out.println("\tgot:\t"+e.getValue()); + errorCount++; + } + } + + if (parsedComments.size() != wantedComments.size()) { + System.out.println("Found " + (wantedComments.size()-parsedComments.size()) + " missed comment(s)!"); + errorCount++; + } + + System.exit(errorCount); + } +} diff --git a/Examples/test-suite/java/doxygen_parsing_enums_typesafe_runme.java b/Examples/test-suite/java/doxygen_parsing_enums_typesafe_runme.java new file mode 100644 index 000000000..8d87c82d0 --- /dev/null +++ b/Examples/test-suite/java/doxygen_parsing_enums_typesafe_runme.java @@ -0,0 +1,93 @@ + +import doxygen_parsing_enums_typesafe.*; +import com.sun.javadoc.*; +import java.util.HashMap; +import java.util.Map.Entry; +import java.util.Iterator; + +public class doxygen_parsing_enums_typesafe_runme { + static { + try { + System.loadLibrary("doxygen_parsing_enums_typesafe"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); + System.exit(1); + } + } + + static HashMap parsedComments = new HashMap(); + static HashMap wantedComments = new HashMap(); + + public static boolean start(RootDoc root) { + + /* + This method is called by 'javadoc' and gets the whole parsed + java file, we get comments and store them + */ + + ClassDoc[] classes = root.classes(); + + for (int i = 0; i < classes.length; i++) { + + if (classes[i].getRawCommentText().length() > 0) + parsedComments.put(classes[i].name(), classes[i].getRawCommentText()); + + MethodDoc[] methods = classes[i].methods(); + FieldDoc[] fields = classes[i].fields(); + FieldDoc[] constants = classes[i].enumConstants(); + + for (int j = 0; j < constants.length; j++) { + FieldDoc f = constants[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } + for (int j = 0; j < fields.length; j++) { + FieldDoc f = fields[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } + for (int j = 0; j < methods.length; j++) { + MethodDoc m = methods[j]; + if (m.getRawCommentText().length() > 0) + parsedComments.put(m.name(), m.getRawCommentText()); + } + } + return true; + } + + public static void main(String argv[]) + { + /* + Here we are using internal javadoc tool, it accepts the name of the class as paramterer, + and calls the start() method of that class with parsed information. + */ + com.sun.tools.javadoc.Main.execute("doxygen_parsing_enums_typesafe runtime test", + "doxygen_parsing_enums_typesafe_runme", new String[]{"-quiet", "doxygen_parsing_enums_typesafe"}); + + wantedComments.put("E_TEST", " Test enumeration \n"); + wantedComments.put("E_TEST_ONE", " the first item \n"); + wantedComments.put("E_TEST_TWO", " the second \n"); + + int errorCount=0; + Iterator< Entry > it = parsedComments.entrySet().iterator(); + + while (it.hasNext()) + { + Entry e = (Entry) it.next(); + + if (!e.getValue().equals(wantedComments.get(e.getKey()))) { + System.out.println("Documentation comments for " + e.getKey() + " does not match: "); + System.out.println("\texpected:"+wantedComments.get(e.getKey())); + System.out.println("\tgot:\t"+e.getValue()); + errorCount++; + } + } + + if (parsedComments.size() != wantedComments.size()) { + System.out.println("Found " + (wantedComments.size()-parsedComments.size()) + " missed comment(s)!"); + errorCount++; + } + + System.exit(errorCount); + } +} diff --git a/Examples/test-suite/java/doxygen_parsing_enums_typeunsafe_runme.java b/Examples/test-suite/java/doxygen_parsing_enums_typeunsafe_runme.java new file mode 100644 index 000000000..a01007db1 --- /dev/null +++ b/Examples/test-suite/java/doxygen_parsing_enums_typeunsafe_runme.java @@ -0,0 +1,93 @@ + +import doxygen_parsing_enums_typeunsafe.*; +import com.sun.javadoc.*; +import java.util.HashMap; +import java.util.Map.Entry; +import java.util.Iterator; + +public class doxygen_parsing_enums_typeunsafe_runme { + static { + try { + System.loadLibrary("doxygen_parsing_enums_typeunsafe"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); + System.exit(1); + } + } + + static HashMap parsedComments = new HashMap(); + static HashMap wantedComments = new HashMap(); + + public static boolean start(RootDoc root) { + + /* + This method is called by 'javadoc' and gets the whole parsed + java file, we get comments and store them + */ + + ClassDoc[] classes = root.classes(); + + for (int i = 0; i < classes.length; i++) { + + if (classes[i].getRawCommentText().length() > 0) + parsedComments.put(classes[i].name(), classes[i].getRawCommentText()); + + MethodDoc[] methods = classes[i].methods(); + FieldDoc[] fields = classes[i].fields(); + FieldDoc[] constants = classes[i].enumConstants(); + + for (int j = 0; j < constants.length; j++) { + FieldDoc f = constants[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } + for (int j = 0; j < fields.length; j++) { + FieldDoc f = fields[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } + for (int j = 0; j < methods.length; j++) { + MethodDoc m = methods[j]; + if (m.getRawCommentText().length() > 0) + parsedComments.put(m.name(), m.getRawCommentText()); + } + } + return true; + } + + public static void main(String argv[]) + { + /* + Here we are using internal javadoc tool, it accepts the name of the class as paramterer, + and calls the start() method of that class with parsed information. + */ + com.sun.tools.javadoc.Main.execute("doxygen_parsing_enums_typeunsafe runtime test", + "doxygen_parsing_enums_typeunsafe_runme", new String[]{"-quiet", "doxygen_parsing_enums_typeunsafe"}); + + wantedComments.put("E_TEST", " Test enumeration \n"); + wantedComments.put("E_TEST_ONE", " the first item \n"); + wantedComments.put("E_TEST_TWO", " the second \n"); + + int errorCount=0; + Iterator< Entry > it = parsedComments.entrySet().iterator(); + + while (it.hasNext()) + { + Entry e = (Entry) it.next(); + + if (!e.getValue().equals(wantedComments.get(e.getKey()))) { + System.out.println("Documentation comments for " + e.getKey() + " does not match: "); + System.out.println("\texpected:"+wantedComments.get(e.getKey())); + System.out.println("\tgot:\t"+e.getValue()); + errorCount++; + } + } + + if (parsedComments.size() != wantedComments.size()) { + System.out.println("Found " + (wantedComments.size()-parsedComments.size()) + " missed comment(s)!"); + errorCount++; + } + + System.exit(errorCount); + } +} diff --git a/Examples/test-suite/java/doxygen_parsing_runme.java b/Examples/test-suite/java/doxygen_parsing_runme.java index c4264d003..fe4b75fa5 100644 --- a/Examples/test-suite/java/doxygen_parsing_runme.java +++ b/Examples/test-suite/java/doxygen_parsing_runme.java @@ -33,6 +33,19 @@ public class doxygen_parsing_runme { parsedComments.put(classes[i].name(), classes[i].getRawCommentText()); MethodDoc[] methods = classes[i].methods(); + FieldDoc[] fields = classes[i].fields(); + FieldDoc[] constants = classes[i].enumConstants(); + + for (int j = 0; j < constants.length; j++) { + FieldDoc f = constants[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } + for (int j = 0; j < fields.length; j++) { + FieldDoc f = fields[j]; + if (f.getRawCommentText().length() > 0) + parsedComments.put(f.name(), f.getRawCommentText()); + } for (int j = 0; j < methods.length; j++) { MethodDoc m = methods[j]; if (m.getRawCommentText().length() > 0) @@ -84,6 +97,11 @@ public class doxygen_parsing_runme { } } + if (parsedComments.size() != wantedComments.size()) { + System.out.println("Found " + (wantedComments.size()-parsedComments.size()) + " missed comment(s)!"); + errorCount++; + } + System.exit(errorCount); } } diff --git a/Source/DoxygenTranslator/src/JavaDocConverter.cpp b/Source/DoxygenTranslator/src/JavaDocConverter.cpp index 8cca8b3a5..23f8c6d3e 100644 --- a/Source/DoxygenTranslator/src/JavaDocConverter.cpp +++ b/Source/DoxygenTranslator/src/JavaDocConverter.cpp @@ -13,7 +13,7 @@ #include "DoxygenParser.h" #include #define APPROX_LINE_LENGTH 64 //characters per line allowed -#define TAB_SIZE 8 //characters per line allowed +#define TAB_SIZE 8 //current tab size in spaces int printSortedTree2 = 0; //TODO {@link} {@linkplain} {@docRoot}, and other useful doxy commands that are not a javadoc tag diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index bfde4f19a..8455fbbf6 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -49,7 +49,7 @@ class JAVA:public Language { bool global_variable_flag; // Flag for when wrapping a global variable bool old_variable_names; // Flag for old style variable names in the intermediary class bool member_func_flag; // flag set when wrapping a member function - bool doxygen_javadoc_flag; //flag for converting found doxygen to javadoc + bool doxygen; //flag for converting found doxygen to javadoc bool comment_creation_chatter; //flag for getting information about where comments were created in java.cxx String *imclass_name; // intermediary class name @@ -123,7 +123,7 @@ public: global_variable_flag(false), old_variable_names(false), member_func_flag(false), - doxygen_javadoc_flag(true), + doxygen(true), comment_creation_chatter(false), imclass_name(NULL), module_class_name(NULL), @@ -255,6 +255,14 @@ public: Printf(stderr, "Deprecated command line option: %s. Proxy classes are now generated by default.\n", argv[i]); Swig_mark_arg(i); proxy_flag = true; + } else if ((strcmp(argv[i], "-doxygen") == 0)) { + Swig_mark_arg(i); + doxygen = true; + scan_doxygen_comments = true; + } else if ((strcmp(argv[i], "-nodoxygen") == 0)) { + Swig_mark_arg(i); + doxygen = false; + scan_doxygen_comments = false; } else if ((strcmp(argv[i], "-noproxy") == 0)) { Swig_mark_arg(i); proxy_flag = false; @@ -528,7 +536,7 @@ public: // Start writing out the module class file emitBanner(f_module); //Add any structural comments to the top - if(doxygen_javadoc_flag && structuralComments){ + if(doxygen && structuralComments){ Printf(f_module, "%s", structuralComments); } if (package) @@ -537,7 +545,7 @@ public: if (module_imports) Printf(f_module, "%s\n", module_imports); - if (doxygen_javadoc_flag){ + if (doxygen){ String *doxygen_comments; if(DoxygenTranslator::getDocumentation(n, JavaDoc,doxygen_comments)){ if(comment_creation_chatter) @@ -1292,17 +1300,6 @@ public: // Add extra indentation Replaceall(enum_code, "\n", "\n "); Replaceall(enum_code, " \n", "\n"); - - //translate and write javadoc comment if flagged - if (doxygen_javadoc_flag){ - String *doxygen_comments; - if(DoxygenTranslator::getDocumentation(n, JavaDoc,doxygen_comments)){ - if(comment_creation_chatter) - Printf(proxy_class_constants_code, "/* This was generated from enumvalueDeclaration() */"); - Printf(proxy_class_constants_code, Char(doxygen_comments)); - Delete(doxygen_comments); - } - } Printv(proxy_class_constants_code, " ", enum_code, "\n\n", NIL); } else { @@ -1418,30 +1415,29 @@ public: } if (!addSymbol(name, n, scope)) return SWIG_ERROR; + + //translate and write javadoc comment if flagged + if (doxygen){ + String *doxygen_comments; + if(DoxygenTranslator::getDocumentation(n, JavaDoc, doxygen_comments)){ + if(comment_creation_chatter) + Printf(enum_code, "/* This was generated from enumvalueDeclaration() */"); + Printf(enum_code, Char(doxygen_comments)); + Delete(doxygen_comments); + } + } if ((enum_feature == ProperEnum) && parent_name && !unnamedinstance) { // Wrap (non-anonymous) C/C++ enum with a proper Java enum // Emit the enum item. - if (!GetFlag(n, "firstenumitem")) - Printf(enum_code, ",\n"); - - //translate and write javadoc comment if flagged - if (doxygen_javadoc_flag){ - String *doxygen_comments; - if(DoxygenTranslator::getDocumentation(n, JavaDoc,doxygen_comments)){ - if(comment_creation_chatter) - Printf(enum_code, "/* This was generated from enumvalueDeclaration() */"); - Printf(enum_code, Char(doxygen_comments)); - Delete(doxygen_comments); - } - } - + Printf(enum_code, " %s", symname); if (Getattr(n, "enumvalue")) { String *value = enumValue(n); Printf(enum_code, "(%s)", value); Delete(value); } + Printf(enum_code, ",\n"); } else { // Wrap C/C++ enums with constant integers or use the typesafe enum pattern SwigType *typemap_lookup_type = parent_name ? parent_name : NewString("enum "); @@ -1493,7 +1489,7 @@ public: * file * ------------------------------------------------------------------------ */ virtual int doxygenComment(Node *n){ - if (doxygen_javadoc_flag){ + if (doxygen){ String *doxygen_comments; if(DoxygenTranslator::getDocumentation(n, JavaDoc, doxygen_comments)){ if(comment_creation_chatter) @@ -1527,7 +1523,7 @@ public: Swig_save("constantWrapper", n, "value", NIL); //translate and write javadoc comment if flagged - if (doxygen_javadoc_flag){ + if (doxygen){ String *doxygen_comments; if(DoxygenTranslator::getDocumentation(n, JavaDoc, doxygen_comments)){ if(comment_creation_chatter) @@ -1825,7 +1821,7 @@ public: const String *pure_interfaces = typemapLookup(n, "javainterfaces", typemap_lookup_type, WARN_NONE); //translate and write javadoc comment if flagged - if (doxygen_javadoc_flag){ + if (doxygen){ String *doxygen_comments; if(DoxygenTranslator::getDocumentation(n, JavaDoc, doxygen_comments)){ if(comment_creation_chatter) @@ -2231,7 +2227,7 @@ public: } //translate and write javadoc comment if flagged - if (doxygen_javadoc_flag){ + if (doxygen){ String *doxygen_comments; if(DoxygenTranslator::getDocumentation(n, JavaDoc, doxygen_comments)){ if(comment_creation_chatter) @@ -2464,7 +2460,7 @@ public: Printf(im_return_type, "%s", tm); //translate and write javadoc comment if flagged - if (doxygen_javadoc_flag){ + if (doxygen){ String *doxygen_comments; if(DoxygenTranslator::getDocumentation(n, JavaDoc, doxygen_comments)){ if(comment_creation_chatter) @@ -2736,7 +2732,7 @@ public: String *post_code = NewString(""); // translate and write javadoc comment if flagged - if (doxygen_javadoc_flag){ + if (doxygen){ String *doxygen_comments; if(DoxygenTranslator::getDocumentation(n, JavaDoc, doxygen_comments)) { if(comment_creation_chatter) @@ -4523,6 +4519,8 @@ extern "C" Language *swig_java(void) { const char *JAVA::usage = (char *) "\ Java Options (available with -java)\n\ + -doxygen - Convert C++ doxygen comments to JavaDoc comments in proxy classes (default)\n\ + -nodoxygen - Don't convert C++ doxygen comments to JavaDoc comments in proxy classes\n\ -nopgcpp - Suppress premature garbage collection prevention parameter\n\ -noproxy - Generate the low-level functional interface instead\n\ of proxy classes\n\