}
// For Map types property name is not optional for ctor params
SettableBeanProperty[] properties = new SettableBeanProperty[argCount];
int nameCount = 0;
for (int i = 0; i < argCount; ++i) {
AnnotatedParameter param = ctor.getParameter(i);
String name = (param == null) ? null : intr.findPropertyNameForParam(param);
// At this point, name annotation is NOT optional
if (name == null || name.length() == 0) {
throw new IllegalArgumentException("Parameter #"+i+" of constructor "+ctor+" has no property name annotation: must have for @JsonCreator for a Map type");
}
++nameCount;
properties[i] = constructCreatorProperty(config, beanDesc, name, i, param);
}
creators.addPropertyConstructor(ctor, properties);
}
// And then if there's a factory creator
for (AnnotatedMethod factory : beanDesc.getFactoryMethods()) {
int argCount = factory.getParameterCount();
if (argCount < 1 || !intr.hasCreatorAnnotation(factory)) { // no args, or not marked with JsonCreator, skip
continue;
}
// Property name is not optional for factory method params
SettableBeanProperty[] properties = new SettableBeanProperty[argCount];
int nameCount = 0;
for (int i = 0; i < argCount; ++i) {
AnnotatedParameter param = factory.getParameter(i);
String name = (param == null) ? null : intr.findPropertyNameForParam(param);
// At this point, name annotation is NOT optional
if (name == null || name.length() == 0) {
throw new IllegalArgumentException("Parameter #"+i+" of factory method "+factory+" has no property name annotation: must have for @JsonCreator for a Map type");
}