aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/jvpp_callback_facade_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/jvpp_callback_facade_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/jvpp_callback_facade_gen.py')
-rw-r--r--vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py29
1 files changed, 22 insertions, 7 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py b/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py
index 731bd894cee..7b8723bf87c 100644
--- a/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_callback_facade_gen.py
@@ -22,6 +22,11 @@ import dto_gen
jvpp_ifc_template = Template("""
package $base_package.$callback_facade_package;
+/**
+ * <p>Callback Java API representation of vpe.api.
+ * <br>It was generated by jvpp_callback_facade_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
+ */
public interface CallbackJVpp extends java.lang.AutoCloseable {
@Override
@@ -36,6 +41,11 @@ $methods
jvpp_impl_template = Template("""
package $base_package.$callback_facade_package;
+/**
+ * <p>Default implementation of CallbackJVpp interface.
+ * <br>It was generated by jvpp_callback_facade_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
+ */
public final class CallbackJVppFacade implements $base_package.$callback_facade_package.CallbackJVpp {
private final $base_package.JVpp jvpp;
@@ -78,7 +88,7 @@ no_arg_method_impl_template = Template(""" public final void $name($base_pack
""")
-def generate_jvpp(func_list, base_package, dto_package, callback_package, callback_facade_package):
+def generate_jvpp(func_list, base_package, dto_package, callback_package, callback_facade_package, inputfile):
""" Generates callback facade """
print "Generating JVpp callback facade"
@@ -131,7 +141,8 @@ def generate_jvpp(func_list, base_package, dto_package, callback_package, callba
join = os.path.join(callback_facade_package, "CallbackJVpp.java")
jvpp_file = open(join, 'w')
jvpp_file.write(
- jvpp_ifc_template.substitute(methods="\n".join(methods),
+ jvpp_ifc_template.substitute(inputfile=inputfile,
+ methods="\n".join(methods),
base_package=base_package,
dto_package=dto_package,
callback_facade_package=callback_facade_package))
@@ -139,7 +150,8 @@ def generate_jvpp(func_list, base_package, dto_package, callback_package, callba
jvpp_file.close()
jvpp_file = open(os.path.join(callback_facade_package, "CallbackJVppFacade.java"), 'w')
- jvpp_file.write(jvpp_impl_template.substitute(methods="\n".join(methods_impl),
+ jvpp_file.write(jvpp_impl_template.substitute(inputfile=inputfile,
+ methods="\n".join(methods_impl),
base_package=base_package,
dto_package=dto_package,
callback_package=callback_package,
@@ -147,14 +159,16 @@ def generate_jvpp(func_list, base_package, dto_package, callback_package, callba
jvpp_file.flush()
jvpp_file.close()
- generate_callback(func_list, base_package, dto_package, callback_package, callback_facade_package)
+ generate_callback(func_list, base_package, dto_package, callback_package, callback_facade_package, inputfile)
jvpp_facade_callback_template = Template("""
package $base_package.$callback_facade_package;
/**
- * Async facade callback setting values to future objects
+ * <p>JVppGlobalCallback implementation for Java Callback API.
+ * <br>It was generated by jvpp_callback_facade_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
*/
public final class CallbackJVppFacadeCallback implements $base_package.$callback_package.JVppGlobalCallback {
@@ -185,7 +199,7 @@ jvpp_facade_callback_method_template = Template("""
""")
-def generate_callback(func_list, base_package, dto_package, callback_package, callback_facade_package):
+def generate_callback(func_list, base_package, dto_package, callback_package, callback_facade_package, inputfile):
callbacks = []
for func in func_list:
@@ -204,7 +218,8 @@ def generate_callback(func_list, base_package, dto_package, callback_package, ca
callback_dto=camel_case_name_with_suffix))
jvpp_file = open(os.path.join(callback_facade_package, "CallbackJVppFacadeCallback.java"), 'w')
- jvpp_file.write(jvpp_facade_callback_template.substitute(base_package=base_package,
+ jvpp_file.write(jvpp_facade_callback_template.substitute(inputfile=inputfile,
+ base_package=base_package,
dto_package=dto_package,
callback_package=callback_package,
methods="".join(callbacks),