summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/jvppgen/util.py
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-07-26 15:28:22 +0200
committerDave Wallace <dwallacelf@gmail.com>2016-08-16 21:26:19 +0000
commit66ea26b1bc7bbc8d54a3498dbd3d0919c4712fa8 (patch)
tree16c46e75723099ad859128af6069055e68897300 /vpp-api/java/jvpp/gen/jvppgen/util.py
parentf4691cd7befd4cf31a63adffc204d71b1f1548e1 (diff)
VPP-205: jvpp plugin support.
Splits jvpp into two jars jvpp-registry.jar - base jvpp functionality jvpp-core.jar - Java wrapper for vpe.api Plugins can be generated the same way jvpp-core.jar is. Example (nsh): https://gerrit.fd.io/r/#/c/2118/ Change-Id: I2254f90b2c3e423563bb91bf70877979f1e90a7d Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'vpp-api/java/jvpp/gen/jvppgen/util.py')
-rw-r--r--vpp-api/java/jvpp/gen/jvppgen/util.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/vpp-api/java/jvpp/gen/jvppgen/util.py b/vpp-api/java/jvpp/gen/jvppgen/util.py
index f22132dfbc1..0018e014dc4 100644
--- a/vpp-api/java/jvpp/gen/jvppgen/util.py
+++ b/vpp-api/java/jvpp/gen/jvppgen/util.py
@@ -120,15 +120,18 @@ jni_field_accessors = {
'jfloatArray': 'ObjectField'
}
-# TODO watch out for unsigned types
+# Mapping according to:
# http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/types.html
-vpp_2_jni_type_mapping = {'u8': 'jbyte', # fixme
+#
+# Unsigned types are converted to signed java types that have the same size.
+# It is the API user responsibility to interpret them correctly.
+vpp_2_jni_type_mapping = {'u8': 'jbyte',
'i8': 'jbyte',
'u16': 'jshort',
'i16': 'jshort',
- 'u32': 'jint', # fixme
+ 'u32': 'jint',
'i32': 'jint',
- 'u64': 'jlong', # fixme
+ 'u64': 'jlong',
'i64': 'jlong',
'f64': 'jdouble'
}
@@ -179,7 +182,7 @@ def remove_suffix(camel_case_name_with_suffix, suffix):
def is_control_ping(camel_case_name_with_suffix):
- return "controlping" in camel_case_name_with_suffix.lower()
+ return camel_case_name_with_suffix.lower().startswith("controlping");
def api_message_to_javadoc(api_message):
""" Converts vpe.api message description to javadoc """