aboutsummaryrefslogtreecommitdiffstats
path: root/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
diff options
context:
space:
mode:
Diffstat (limited to 'extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py')
-rwxr-xr-xextras/japi/java/jvpp/gen/jvppgen/jvpp_model.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py b/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
index 16099689880..da1e01f5a63 100755
--- a/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
+++ b/extras/japi/java/jvpp/gen/jvppgen/jvpp_model.py
@@ -92,9 +92,11 @@ class SimpleType(Type):
# TODO(VPP-1187): add array host to net functions to reduce number of members and simplify JNI generation
class Array(Type):
- def __init__(self, base_type):
+ def __init__(self, base_type, name=None):
+ if name is None:
+ name = base_type.name + _ARRAY_SUFFIX
super(Array, self).__init__(
- name=base_type.name + _ARRAY_SUFFIX,
+ name=name,
java_name=base_type.java_name + _ARRAY_SUFFIX,
java_name_fqn=base_type.java_name_fqn + _ARRAY_SUFFIX,
jni_signature="[%s" % base_type.jni_signature,
@@ -341,6 +343,8 @@ class JVppModel(object):
self._parse_types(types)
def _parse_aliases(self, types):
+
+ # model aliases
for alias_name in self._aliases:
alias = self._aliases[alias_name]
alias_type = {"type": "type"}
@@ -442,7 +446,10 @@ class JVppModel(object):
'i64': SimpleType('i64', 'long', 'J', 'jlong', 'Long',
host_to_net_function='clib_host_to_net_i64',
net_to_host_function='clib_net_to_host_i64'),
- 'f64': SimpleType('f64', 'double', 'D', 'jdouble', 'Double')
+ 'f64': SimpleType('f64', 'double', 'D', 'jdouble', 'Double'),
+ 'string': SimpleType('string', 'String', 'l', 'jstring', 'Object',
+ host_to_net_function='_host_to_net_string',
+ net_to_host_function='_net_to_host_string')
})
for n, t in self._types_by_name.items():