protected ClassType getServiceScope(ClassElement serviceElement) { List<AnnotationMirrorElement> annMirors = serviceElement.getAnnotationMirrors(); DeclaredType scopeType = null; for (AnnotationMirrorElement annMirr : annMirors) { DeclaredType annType = annMirr.getType(); CustomScope customScope = annType.getAnnotation(CustomScope.class); if (customScope != null) { if (scopeType != null) { throw CodegenException.of().message("Ambiguous scope declaration").element(serviceElement).build(); } else { scopeType = annType; } } } return scopeType==null? null: new ClassType(context.getProcessingEnv(), scopeType); }