PetiteInject ref = ctor.getAnnotation(PetiteInject.class);
if (ref == null) {
continue;
}
if (foundedCtor != null) {
throw new PetiteException("Two or more constructors are annotated as injection points in bean: " + type.getName());
}
foundedCtor = ctor;
refValues = ref.value().trim();
}
if (foundedCtor == null) {
if (allCtors.length == 1) {
foundedCtor = allCtors[0].getConstructor();
} else {
foundedCtor = defaultCtor;
}
}
if (foundedCtor == null) {
throw new PetiteException("No constructor (annotated, single or default) founded as injection point for: " + type.getName());
}
String[][] references = PetiteUtil.convertAnnValueToReferences(refValues);
return injectionPointFactory.createCtorInjectionPoint(foundedCtor, references);