Somewhat redundant changes (new file_ext, arg parse, etc)
[ldk-java] / java_strings.py
index 45bb7e8273ff81f8010e717241a1c7f75b77a852..080f3b17def7f44d0fb9e24fb5ea9dcfc6b963f0 100644 (file)
@@ -1,7 +1,23 @@
 from bindingstypes import *
 
-class Consts:
+from language_constants import LanguageConstants
+
+class Consts(LanguageConstants):
     def __init__(self, DEBUG):
+        super().__init__()
+
+        self.file_extension = 'java'
+
+        self.common_base = """package org.ldk.structs;
+import java.util.LinkedList;
+class CommonBase {
+       long ptr;
+       LinkedList<Object> ptrs_to = new LinkedList();
+       protected CommonBase(long ptr) { this.ptr = ptr; }
+       public long _test_only_get_ptr() { return this.ptr; }
+}
+"""
+
         self.c_file_pfx = """#include \"org_ldk_impl_bindings.h\"
 #include <rust_types.h>
 #include <lightning.h>