mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-14 16:36:55 +00:00
Add @javax.annotation.Generated to generated flatbuffer Java types (#4986)
* Add @javax.annotation.Generated to generated flatbuffer Java types. * Updating test goldens.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
99fe1dc80f
commit
233976c821
@@ -56,6 +56,7 @@ struct LanguageParameters {
|
||||
std::string optional_suffix;
|
||||
std::string includes;
|
||||
std::string class_annotation;
|
||||
std::string generated_type_annotation;
|
||||
CommentConfig comment_config;
|
||||
};
|
||||
|
||||
@@ -87,7 +88,8 @@ const LanguageParameters &GetLangParams(IDLOptions::Language lang) {
|
||||
"",
|
||||
"import java.nio.*;\nimport java.lang.*;\nimport "
|
||||
"java.util.*;\nimport com.google.flatbuffers.*;\n",
|
||||
"\n@SuppressWarnings(\"unused\")\n",
|
||||
"\n@SuppressWarnings(\"unused\")",
|
||||
"\n@javax.annotation.Generated(value=\"flatc\")\n",
|
||||
{
|
||||
"/**",
|
||||
" *",
|
||||
@@ -120,6 +122,7 @@ const LanguageParameters &GetLangParams(IDLOptions::Language lang) {
|
||||
"?",
|
||||
"using global::System;\nusing global::FlatBuffers;\n\n",
|
||||
"",
|
||||
"",
|
||||
{
|
||||
nullptr,
|
||||
"///",
|
||||
@@ -218,6 +221,7 @@ class GeneralGenerator : public BaseGenerator {
|
||||
}
|
||||
code += lang_.class_annotation;
|
||||
}
|
||||
code += lang_.generated_type_annotation;
|
||||
code += classcode;
|
||||
if (!namespace_name.empty()) code += lang_.namespace_end;
|
||||
auto filename = NamespaceDir(ns) + defname + lang_.file_extension;
|
||||
|
||||
Reference in New Issue
Block a user