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:
parent
c471f1ed46
commit
9eeda24047
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue