summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/callback_gen.py
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-api/java/jvpp/gen/callback_gen.py')
-rw-r--r--vpp-api/java/jvpp/gen/callback_gen.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/vpp-api/java/jvpp/gen/callback_gen.py b/vpp-api/java/jvpp/gen/callback_gen.py
index 218ac62298b..8a0d20124ae 100644
--- a/vpp-api/java/jvpp/gen/callback_gen.py
+++ b/vpp-api/java/jvpp/gen/callback_gen.py
@@ -25,7 +25,11 @@ callback_template = Template("""
package $base_package.$callback_package;
/**
- * $docs
+ * <p>Represents callback for vpe.api message.
+ * <br>It was generated by callback_gen.py based on $inputfile preparsed data:
+ * <pre>
+$docs
+ * </pre>
*/
public interface $cls_name extends $base_package.$callback_package.JVppCallback {
@@ -38,16 +42,16 @@ global_callback_template = Template("""
package $base_package.$callback_package;
/**
- *
- *
- * Global aggregated callback interface
+ * <p>Global aggregated callback interface.
+ * <br>It was generated by callback_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
*/
public interface JVppGlobalCallback extends $callbacks {
}
""")
-def generate_callbacks(func_list, base_package, callback_package, dto_package):
+def generate_callbacks(func_list, base_package, callback_package, dto_package, inputfile):
""" Generates callback interfaces """
print "Generating Callback interfaces"
@@ -73,7 +77,8 @@ def generate_callbacks(func_list, base_package, callback_package, dto_package):
reply_type = "%s.%s.%s" % (base_package, dto_package, camel_case_name_with_suffix)
method = "void on{0}({1} reply);".format(camel_case_name_with_suffix, reply_type)
callback_file.write(
- callback_template.substitute(docs='Generated from ' + str(func),
+ callback_template.substitute(inputfile=inputfile,
+ docs=util.api_message_to_javadoc(func),
cls_name=camel_case_name + callback_suffix,
callback_method=method,
base_package=base_package,
@@ -82,7 +87,8 @@ def generate_callbacks(func_list, base_package, callback_package, dto_package):
callback_file.close()
callback_file = open(os.path.join(callback_package, "JVppGlobalCallback.java"), 'w')
- callback_file.write(global_callback_template.substitute(callbacks=", ".join(callbacks),
+ callback_file.write(global_callback_template.substitute(inputfile=inputfile,
+ callbacks=", ".join(callbacks),
base_package=base_package,
callback_package=callback_package))
callback_file.flush()