/** * Process a set of classes from the parameter list rather than from the * processing context. This allow the annotation handlers to call be the * annotation processing tool when classes need to be processed in a * particular context rather than when they are picked up by the scanner. * * @param ctx the processing context * @param classes the list of classes to process * @return the processing result for such classes * @throws AnnotationProcessorException if handlers fail to process * an annotation */ public ProcessingResult process(ProcessingContext ctx, Class[] classes) throws AnnotationProcessorException { ProcessingResultImpl result = new ProcessingResultImpl(); for (Class c : classes) { result.add(process(ctx, c)); } return result; }
/** * Process a set of classes from the parameter list rather than from the * processing context. This allow the annotation handlers to call be the * annotation processing tool when classes need to be processed in a * particular context rather than when they are picked up by the scanner. * * @param ctx the processing context * @param classes the list of classes to process * @return the processing result for such classes * @throws AnnotationProcessorException if handlers fail to process * an annotation */ public ProcessingResult process(ProcessingContext ctx, Class[] classes) throws AnnotationProcessorException { ProcessingResultImpl result = new ProcessingResultImpl(); for (Class c : classes) { result.add(process(ctx, c)); } return result; }
private HandlerProcessingResult processAnnotations(ProcessingContext ctx, AnnotatedElement element) throws AnnotationProcessorException { HandlerProcessingResultImpl result= new HandlerProcessingResultImpl(); try{ for (Annotation annotation : element.getAnnotations()) { // initialize the result... AnnotationInfo subElement = new AnnotationInfo(ctx, element, annotation, getTopElementType()); if (!result.processedAnnotations().containsKey(annotation.annotationType())) { process(ctx, subElement, result); } else { if (AnnotationUtils.shouldLog("annotation")) { logger.finer("Annotation " + annotation.annotationType() + " already processed"); } } } } catch (ArrayStoreException e) { logger.info("Exception " + e.toString() + " encountered while processing annotaton for element " + element + ". Message is: " + e.getMessage() + ". Ignoring annotations and proceeding."); } return result; }
private HandlerProcessingResult processAnnotations(ProcessingContext ctx, AnnotatedElement element) throws AnnotationProcessorException { HandlerProcessingResultImpl result= new HandlerProcessingResultImpl(); try{ for (Annotation annotation : element.getAnnotations()) { // initialize the result... AnnotationInfo subElement = new AnnotationInfo(ctx, element, annotation, getTopElementType()); if (!result.processedAnnotations().containsKey(annotation.annotationType())) { process(ctx, subElement, result); } else { if (AnnotationUtils.shouldLog("annotation")) { logger.finer("Annotation " + annotation.annotationType() + " already processed"); } } } } catch (ArrayStoreException e) { logger.info("Exception " + e.toString() + " encountered while processing annotaton for element " + element + ". Message is: " + e.getMessage() + ". Ignoring annotations and proceeding."); } return result; }
/** * Starts the annotation processing tool passing the processing context which * encapuslate all information necessary for the configuration of the tool. * @param ctx is the initialized processing context * @return the result of the annoations processing */ public ProcessingResult process(ProcessingContext ctx) throws AnnotationProcessorException { Scanner<Object> scanner = ctx.getProcessingInput(); ProcessingResultImpl result = new ProcessingResultImpl(); errorCount=0; for (Class c : scanner.getElements()) { result.add(process(ctx, c)); } return result; }
/** * Starts the annotation processing tool passing the processing context which * encapuslate all information necessary for the configuration of the tool. * @param ctx is the initialized processing context * @return the result of the annoations processing */ public ProcessingResult process(ProcessingContext ctx) throws AnnotationProcessorException { Scanner<Object> scanner = ctx.getProcessingInput(); ProcessingResultImpl result = new ProcessingResultImpl(); errorCount=0; for (Class c : scanner.getElements()) { result.add(process(ctx, c)); } return result; }
private HandlerProcessingResult processParameters(ProcessingContext ctx, Annotation[][] parametersAnnotations) throws AnnotationProcessorException { HandlerProcessingResultImpl result = new HandlerProcessingResultImpl(); // process the method parameters... for (Annotation[] parameterAnnotations : parametersAnnotations) { logStart(ctx.getHandler(), ElementType.PARAMETER, null); if (parameterAnnotations!=null) { for (Annotation annotation : parameterAnnotations) { AnnotationInfo info = new AnnotationInfo(ctx, null, annotation, ElementType.PARAMETER); process(ctx, info, result); dumpProcessingResult(result); } } logEnd(ctx.getHandler(), ElementType.PARAMETER, null); } return result; }
private HandlerProcessingResult processParameters(ProcessingContext ctx, Annotation[][] parametersAnnotations) throws AnnotationProcessorException { HandlerProcessingResultImpl result = new HandlerProcessingResultImpl(); // process the method parameters... for (Annotation[] parameterAnnotations : parametersAnnotations) { logStart(ctx.getHandler(), ElementType.PARAMETER, null); if (parameterAnnotations!=null) { for (Annotation annotation : parameterAnnotations) { AnnotationInfo info = new AnnotationInfo(ctx, null, annotation, ElementType.PARAMETER); process(ctx, info, result); dumpProcessingResult(result); } } logEnd(ctx.getHandler(), ElementType.PARAMETER, null); } return result; }