summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/jvpp_impl_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_impl_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_impl_gen.py')
-rw-r--r--vpp-api/java/jvpp/gen/jvpp_impl_gen.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_impl_gen.py b/vpp-api/java/jvpp/gen/jvpp_impl_gen.py
index 5446a694c1b..08ebddfcf97 100644
--- a/vpp-api/java/jvpp/gen/jvpp_impl_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_impl_gen.py
@@ -19,6 +19,12 @@ from string import Template
jvpp_ifc_template = Template("""
package $base_package;
+
+/**
+ * <p>Java representation of vpe.api.
+ * <br>It was generated by jvpp_impl_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
+ */
public interface JVpp extends java.lang.AutoCloseable {
/**
@@ -36,6 +42,11 @@ $methods
jvpp_impl_template = Template("""
package $base_package;
+/**
+ * <p>Default implementation of JVpp interface.
+ * <br>It was generated by jvpp_impl_gen.py based on $inputfile
+ * <br>(python representation of vpe.api generated by vppapigen).
+ */
public final class JVppImpl implements $base_package.JVpp {
private final $base_package.VppConnection connection;
@@ -82,7 +93,7 @@ no_arg_method_impl_template = Template(""" public final int $name() {
""")
-def generate_jvpp(func_list, base_package, dto_package):
+def generate_jvpp(func_list, base_package, dto_package, inputfile):
""" Generates JVpp interface and JNI implementation """
print "Generating JVpp"
@@ -126,14 +137,16 @@ def generate_jvpp(func_list, base_package, dto_package):
jvpp_file = open("JVpp.java", '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))
jvpp_file.flush()
jvpp_file.close()
jvpp_file = open("JVppImpl.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))
jvpp_file.flush()