Better control on what the java base class is (overriding the real C++ base class with the javabase 'replace' typemap attribute)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9446 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
271885b0e5
commit
9a1bd4a9e0
1 changed files with 12 additions and 5 deletions
|
|
@ -1558,12 +1558,19 @@ class JAVA : public Language {
|
|||
baseclass = NewString("");
|
||||
|
||||
// Inheritance from pure Java classes
|
||||
const String *pure_baseclass = typemapLookup("javabase", typemap_lookup_type, WARN_NONE);
|
||||
Node *attributes = NewHash();
|
||||
const String *pure_baseclass = typemapLookup("javabase", typemap_lookup_type, WARN_NONE, attributes);
|
||||
if (Len(pure_baseclass) > 0 && Len(baseclass) > 0) {
|
||||
Swig_warning(WARN_JAVA_MULTIPLE_INHERITANCE, input_file, line_number,
|
||||
"Warning for %s proxy: Base %s ignored. Multiple inheritance is not supported in Java.\n", typemap_lookup_type, pure_baseclass);
|
||||
pure_baseclass = empty_string;
|
||||
if (GetFlag(attributes, "tmap:javabase:replace")) {
|
||||
Delete(baseclass);
|
||||
baseclass = NewString("");
|
||||
} else {
|
||||
Swig_warning(WARN_JAVA_MULTIPLE_INHERITANCE, input_file, line_number,
|
||||
"Warning for %s proxy: Base %s ignored. Multiple inheritance is not supported in Java.\n", typemap_lookup_type, pure_baseclass);
|
||||
pure_baseclass = empty_string;
|
||||
}
|
||||
}
|
||||
Delete(attributes);
|
||||
|
||||
// Pure Java interfaces
|
||||
const String *pure_interfaces = typemapLookup("javainterfaces", typemap_lookup_type, WARN_NONE);
|
||||
|
|
@ -1593,7 +1600,7 @@ class JAVA : public Language {
|
|||
// Note that the method name is specified in a typemap attribute called methodname
|
||||
String *destruct = NewString("");
|
||||
const String *tm = NULL;
|
||||
Node *attributes = NewHash();
|
||||
attributes = NewHash();
|
||||
String *destruct_methodname = NULL;
|
||||
String *destruct_methodmodifiers = NULL;
|
||||
if (derived) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue