typesafe enum support for storing the enum name (for toString)

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5958 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-05-31 07:24:54 +00:00
commit 9eeda24047

View file

@ -1220,10 +1220,10 @@ class JAVA : public Language {
// Wrap (non-anonymouse) enum using the typesafe enum pattern // Wrap (non-anonymouse) enum using the typesafe enum pattern
if (Getattr(n,"enumvalue")) { if (Getattr(n,"enumvalue")) {
String *value = enumValue(n); String *value = enumValue(n);
Printf(enum_code, " public final static %s %s = new %s(%s);\n", return_type, symname, return_type, value); Printf(enum_code, " public final static %s %s = new %s(\"%s\", %s);\n", return_type, symname, return_type, symname, value);
Delete(value); Delete(value);
} else { } else {
Printf(enum_code, " public final static %s %s = new %s();\n", return_type, symname, return_type); Printf(enum_code, " public final static %s %s = new %s(\"%s\");\n", return_type, symname, return_type, symname);
} }
} else { } else {
// Simple integer constants // Simple integer constants