private void initRegisteredAnnotations() { if (null == registeredAnnotationNames) { final Collection<String> nameSet = new HashSet<String>(); for (Processor processor : LombokProcessorExtensionPoint.EP_NAME.getExtensions()) { Class<? extends Annotation> annotationClass = processor.getSupportedAnnotationClass(); nameSet.add(annotationClass.getSimpleName()); nameSet.add(annotationClass.getName()); } registeredAnnotationNames = nameSet; } }
public LombokInspection() { allProblemHandlers = new THashMap<String, Collection<Processor>>(); for (Processor lombokInspector : LombokProcessorExtensionPoint.EP_NAME.getExtensions()) { Collection<Processor> inspectorCollection = allProblemHandlers.get(lombokInspector.getSupportedAnnotation()); if (null == inspectorCollection) { inspectorCollection = new ArrayList<Processor>(2); allProblemHandlers.put(lombokInspector.getSupportedAnnotation(), inspectorCollection); } inspectorCollection.add(lombokInspector); LOG.debug(String.format("LombokInspection registered %s inspector", lombokInspector)); } }
private <Psi extends PsiElement> List<Psi> process( @NotNull Class<Psi> type, @NotNull Project project, @NotNull PsiClass psiClass) { if (log.isDebugEnabled()) { log.debug( String.format("Process call for type: %s class: %s", type, psiClass.getQualifiedName())); } final List<Psi> result = new ArrayList<Psi>(); for (Processor processor : LombokProcessorExtensionPoint.EP_NAME.getExtensions()) { if (processor.canProduce(type) && processor.isEnabled(project)) { result.addAll((Collection<Psi>) processor.process(psiClass)); } } return result; }