Closed okou19900722 closed 6 years ago
This method will be invoked in the generated code if a service method has a map parameter.
@tsegismont but the value elem cannot be Map or List,the method 'checkParamType' in ProxyModel check Map code is
if (raw.getName().equals(List.class.getName()) || raw.getName().equals(Set.class.getName())) {
TypeInfo argument = ((ParameterizedTypeInfo) type).getArgs().get(0);
if (argument.getKind().basic || argument.getKind().json || argument.getKind() == ClassKind.DATA_OBJECT) {
return true;
}
} else if (raw.getName().equals(Map.class.getName())) {
TypeInfo argument0 = ((ParameterizedTypeInfo) type).getArgs().get(0);
if (!argument0.getName().equals(String.class.getName())) {
return false;
}
TypeInfo argument1 = ((ParameterizedTypeInfo) type).getArgs().get(1);
if (argument1.getKind().basic || argument1.getKind().json) {
return true;
}
}
Key must be String, and Value must be base or json
You are confusing two things:
ProxyModel.checkParamType
is used only during the validation phase of code generation (checking the interface is valid)convertMap
is used at runtime to convert a map parameter@okou19900722 please follow-up on the Vert.x forum if you need more info. We do not use GitHub for questions. Thanks.
@tsegismont yes , but do you think a invalid param will compile success when annotation processor process?
this method in "proxygen.templ" but service method param Map only support Json or basic value,when will the converter invoker
sorry for bad english!I'm Chinese,Thank you