public void visitMethod(Consumer annotation, Method method, Class<?> implClass, InjectingComponentType componentType, IntrospectionContext context) {
if (method.getParameterTypes().length > 1) {
InvalidConsumerMethod failure = new InvalidConsumerMethod("Consumer method " + method + " has more than one parameter", method, componentType);
context.addError(failure);
return;
}
TypeMapping typeMapping = context.getTypeMapping(implClass);
List<DataType<?>> types = introspectParameterTypes(method, typeMapping);
String name = helper.getSiteName(method, annotation.value());
Signature signature = new Signature(method);
ConsumerDefinition definition = new ConsumerDefinition(name, types);
int sequence = annotation.sequence();
if (sequence < 0) {
context.addError(new InvalidConsumerMethod("Sequence number cannot be negative: " + method, method, componentType));
} else {
definition.setSequence(sequence);
}
componentType.add(definition, signature);
}