define annotation schemas using AidlTypeSpecifier
AidlAnnotatoin::CheckValid() creates an AidlTypeSpecifier object to test
the param's value.
In the schema, types for parameters are specified in string literals.
It makes it hard to support other than primitive types, like String[],
because we have to parse a string literal to create a proper
AidlTypeSepcifier object.
For example, @JavaDerive/@RustDerive could have been defined with String[]
to list up values.
@JavaDerive(methods={"toString", "equals"})
Because we know which types are used in annotation schemas, we can
pre-create AidlTypeSpecifier objects and use them to define types of
parameter values instead of string literals.
Bug: none
Test: aidl_unittests
Change-Id: I7a903a14d1017b6baca480ad8326c7b9e7540b4a
diff --git a/aidl_language.h b/aidl_language.h
index 4f24da7..052ba77 100644
--- a/aidl_language.h
+++ b/aidl_language.h
@@ -205,7 +205,7 @@
std::string name;
// map from param name -> value type
- std::map<std::string, std::string> supported_parameters;
+ std::map<std::string, const AidlTypeSpecifier&> supported_parameters;
bool repeatable;