mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 15:16:28 +00:00
has_method support for primitive fields in java runtime. Changed: idl.h, FlatBufferBuilder.java , idl_gen_general.cpp, idl_parser.cpp, flatc.cpp (#5468)
* has_method support for primitive fields in java runtime * adding the new flag to flatc * addressing the review comments
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
acc9990abd
commit
a20e71ac96
@@ -1323,6 +1323,15 @@ class GeneralGenerator : public BaseGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (parser_.opts.java_primitive_has_method &&
|
||||
IsScalar(field.value.type.base_type) && !struct_def.fixed) {
|
||||
auto vt_offset_constant = " public static final int VT_" +
|
||||
MakeScreamingCamel(field.name) + " = " +
|
||||
NumToString(field.value.offset) + ";";
|
||||
|
||||
code += vt_offset_constant;
|
||||
code += "\n";
|
||||
}
|
||||
}
|
||||
code += "\n";
|
||||
flatbuffers::FieldDef *key_field = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user