}
@Override
public void visitConstructorParameter(JavaParameterImpl parameter, JavaImplementation type)
throws IntrospectionException {
Reference refAnnotation = parameter.getAnnotation(Reference.class);
if (refAnnotation == null) {
return;
}
if (!refAnnotation.required()) {
throw new InvalidReferenceException("[JCA90016] Constructor has @Reference with required=false: " + type.getName());
}
if (refAnnotation.name() == null || refAnnotation.name().length() < 1) {
throw new InvalidReferenceException("[JCA90018] @Reference in a Constructor must have a name attribute" + type.getName());
}
String paramName = parameter.getName();
String name = getReferenceName(paramName, parameter.getIndex(), refAnnotation.name());
JavaElementImpl ref = type.getReferenceMembers().get(name);
// Setter override field
if (ref != null && ref.getElementType() != ElementType.FIELD) {
throw new DuplicateReferenceException(name);