Java enums output format fixes
Restore generated Java enum code output to what it was pre-doxygen code changes. Improves code with doxygen comments too.
This commit is contained in:
parent
7d1578e58c
commit
8344aec3a3
1 changed files with 6 additions and 5 deletions
|
|
@ -1373,9 +1373,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Printv(f_enum, typemapLookup(n, "javaimports", typemap_lookup_type, WARN_NONE), // Import statements
|
Printv(f_enum, typemapLookup(n, "javaimports", typemap_lookup_type, WARN_NONE), // Import statements
|
||||||
"\n\n", NIL);
|
"\n", enum_code, "\n", NIL);
|
||||||
|
|
||||||
Printv(f_enum, enum_code, "\n", NIL);
|
|
||||||
|
|
||||||
Printf(f_enum, "\n");
|
Printf(f_enum, "\n");
|
||||||
Delete(f_enum);
|
Delete(f_enum);
|
||||||
|
|
@ -1469,6 +1467,11 @@ public:
|
||||||
if (!addSymbol(symname, n, scope))
|
if (!addSymbol(symname, n, scope))
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
|
|
||||||
|
if ((enum_feature == ProperEnum) && parent_name && !unnamedinstance) {
|
||||||
|
if (!GetFlag(n, "firstenumitem"))
|
||||||
|
Printf(enum_code, ",\n");
|
||||||
|
}
|
||||||
|
|
||||||
// Translate and write javadoc comment if flagged
|
// Translate and write javadoc comment if flagged
|
||||||
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
if (doxygen && doxygenTranslator->hasDocumentation(n)) {
|
||||||
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
String *doxygen_comments = doxygenTranslator->getDocumentation(n);
|
||||||
|
|
@ -1481,14 +1484,12 @@ public:
|
||||||
if ((enum_feature == ProperEnum) && parent_name && !unnamedinstance) {
|
if ((enum_feature == ProperEnum) && parent_name && !unnamedinstance) {
|
||||||
// Wrap (non-anonymous) C/C++ enum with a proper Java enum
|
// Wrap (non-anonymous) C/C++ enum with a proper Java enum
|
||||||
// Emit the enum item.
|
// Emit the enum item.
|
||||||
|
|
||||||
Printf(enum_code, " %s", symname);
|
Printf(enum_code, " %s", symname);
|
||||||
if (Getattr(n, "enumvalue")) {
|
if (Getattr(n, "enumvalue")) {
|
||||||
String *value = enumValue(n);
|
String *value = enumValue(n);
|
||||||
Printf(enum_code, "(%s)", value);
|
Printf(enum_code, "(%s)", value);
|
||||||
Delete(value);
|
Delete(value);
|
||||||
}
|
}
|
||||||
Printf(enum_code, ",\n");
|
|
||||||
} else {
|
} else {
|
||||||
// Wrap C/C++ enums with constant integers or use the typesafe enum pattern
|
// Wrap C/C++ enums with constant integers or use the typesafe enum pattern
|
||||||
SwigType *typemap_lookup_type = parent_name ? parent_name : NewString("enum ");
|
SwigType *typemap_lookup_type = parent_name ? parent_name : NewString("enum ");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue