use of aQute.bnd.component.error.DeclarativeServicesAnnotationError in project bnd by bndtools.
the class AnnotationReader method doActivate.
/**
*
*/
protected void doActivate() {
String methodDescriptor = member.getDescriptor().toString();
DeclarativeServicesAnnotationError details = new DeclarativeServicesAnnotationError(className.getFQN(), member.getName(), methodDescriptor, ErrorType.ACTIVATE_SIGNATURE_ERROR);
if (!(member instanceof MethodDef)) {
analyzer.error("Activate annotation on a field %s.%s", clazz, member.getDescriptor()).details(details);
return;
}
boolean hasMapReturnType = false;
Matcher m = LIFECYCLEDESCRIPTORDS10.matcher(methodDescriptor);
if ("activate".equals(member.getName()) && m.matches()) {
component.activate = member.getName();
hasMapReturnType = m.group(3) != null;
if (!member.isProtected())
component.updateVersion(V1_1);
} else {
m = LIFECYCLEDESCRIPTORDS11.matcher(methodDescriptor);
if (m.matches()) {
component.activate = member.getName();
component.updateVersion(V1_1);
hasMapReturnType = m.group(6) != null;
} else {
m = LIFECYCLEDESCRIPTORDS13.matcher(methodDescriptor);
if (m.matches()) {
component.activate = member.getName();
component.updateVersion(V1_3);
hasMapReturnType = m.group(4) != null;
processAnnotationArguments(methodDescriptor, details);
} else
analyzer.error("Activate method for %s descriptor %s is not acceptable.", clazz, member.getDescriptor()).details(details);
}
}
checkMapReturnType(hasMapReturnType, details);
}
Aggregations