Home / Class/ TestableAnnotationProcessor Class — spring-boot Architecture

TestableAnnotationProcessor Class — spring-boot Architecture

Architecture documentation for the TestableAnnotationProcessor class in TestableAnnotationProcessor.java from the spring-boot codebase.

Entity Profile

Relationship Graph

Source Code

configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/test/TestableAnnotationProcessor.java lines 38–69

@SupportedAnnotationTypes("*")
@SupportedSourceVersion(SourceVersion.RELEASE_8)
public class TestableAnnotationProcessor<T> extends AbstractProcessor {

	private final BiConsumer<RoundEnvironmentTester, T> consumer;

	private final Function<ProcessingEnvironment, T> factory;

	private T target;

	public TestableAnnotationProcessor(BiConsumer<RoundEnvironmentTester, T> consumer,
			Function<ProcessingEnvironment, T> factory) {
		this.consumer = consumer;
		this.factory = factory;
	}

	@Override
	public synchronized void init(ProcessingEnvironment env) {
		this.target = this.factory.apply(env);
	}

	@Override
	public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
		RoundEnvironmentTester tester = new RoundEnvironmentTester(roundEnv);
		if (!roundEnv.getRootElements().isEmpty()) {
			this.consumer.accept(tester, this.target);
			return true;
		}
		return false;
	}

}

Domain

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free