Package io.helidon.builder.processor.spi
Interface BuilderCreatorProvider
public interface BuilderCreatorProvider
Java
ServiceLoader provider interface used to discover builder creators.
Implementors of this contract will be called to process BuilderTrigger-annotated
annotation types that they know how to handle. This is based upon the supportedAnnotationTypes() as well as the
Weight
assigned to the implementation class implementing this interface.
-
Method Summary
Modifier and TypeMethodDescriptioncreate(TypeInfo typeInfo, AnnotationAndValue builderAnnotation) Creates the type and body for what is code generated.Set<Class<? extends Annotation>>The set ofBuilder-like annotations that this creator knows how to handle.
-
Method Details
-
supportedAnnotationTypes
Set<Class<? extends Annotation>> supportedAnnotationTypes()The set ofBuilder-like annotations that this creator knows how to handle. Note that this annotation must also be annotated withBuilderTriggerto qualify for inclusion. This is akin toProcessor.getSupportedAnnotationTypes().- Returns:
- Implementors should return the set of annotations they can handle
-
create
Creates the type and body for what is code generated. Implementors should return and empty list if the given typeInfo is not supported by this creator. Note that the actual code generation is provided directly by the built-in builder tooling module. Implementors, therefore, should only return theTypeAndBodythat describes the code generated class, and only if they are prepared to code generate the builder implementation.- Parameters:
typeInfo- the target type being processed - this type was found to have one of our supported annotations mentioned insupportedAnnotationTypes()builderAnnotation- the annotation that triggered the builder creation- Returns:
- the list of TypeAndBody sources to code-generate (tooling will handle the actual code generation aspects), or empty list to signal that the target type is not handled
-