public void visitMethod(CompositeComponent parent, Method method,
PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
DeploymentContext context)
throws ProcessingException {
Reference annotation = method.getAnnotation(Reference.class);
Autowire autowire = method.getAnnotation(Autowire.class);
boolean isAutowire = autowire != null;
if (annotation == null && !isAutowire) {
return; //Not a reference or autowire annotation.
}
if (method.getParameterTypes().length != 1) {
IllegalReferenceException e = new IllegalReferenceException("Setter must have one parameter");
e.setIdentifier(method.toString());
throw e;
}
//process autowire required first let reference override. or if conflicting should this fault?
boolean required = false;
if (isAutowire) {
required = autowire.required();
}
String name = null;
if (annotation != null) {
if (annotation.name() != null && annotation.name().length() > 0) {
name = annotation.name();
}
required = annotation.required();
}
if (name == null) {
name = method.getName();
if (method.getName().startsWith("set")) {
name = toPropertyName(method.getName());