summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/callback_gen.py
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-04-26 12:09:05 +0200
committerEd Warnicke <hagbard@gmail.com>2016-05-02 20:58:54 +0000
commitd85036fd6bf25bb11a6f3fdfccf4425428834f28 (patch)
tree457505ac351630c88f60d33bddbf1d5789e34f46 /vpp-api/java/jvpp/gen/callback_gen.py
parentc5e8681b320884f780508458ebff873761d5e04a (diff)
HONEYCOMB-10: jVpp - the new java API. C code and jar file generation
Added comments generation for C and Java files. Change-Id: Ifb670a5592eb871bfe68804f0a8d8f9b5b14f00a Signed-off-by: Marek Gradzki <mgradzki@cisco.com> Signed-off-by: Ed Warnicke <eaw@cisco.com>
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()