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:
Rikard Lundmark
2018-10-08 23:29:22 +01:00
committed by Wouter van Oortmerssen
parent 99fe1dc80f
commit 233976c821
20 changed files with 26 additions and 1 deletions

View File

@@ -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;