Interface RegistryRoundContext
- All Superinterfaces:
RoundContext
Context of a single round of code generation.
For example the first round may generate types, that require additional code generation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddDescriptor(TypeName serviceType, TypeName descriptorType, ClassModel.Builder descriptor, double weight, Set<ResolvedType> contracts, Set<ResolvedType> factoryContracts, Object... originatingElements) Add a new service descriptor.serviceContracts(TypeInfo serviceInfo) Create service contracts for the provided service that honor configuration of contract discovery.Methods inherited from interface RoundContext
addGeneratedType, annotatedAnnotations, annotatedElements, annotatedTypes, availableAnnotations, generatedType, modules, typeHierarchyResolver, typeInfo, typesModifier and TypeMethodDescriptionvoidaddGeneratedType(TypeName type, ClassModel.Builder newClass, TypeName mainTrigger, Object... originatingElements) Add a new class to be code generated.default Collection<TypeName> annotatedAnnotations(TypeName metaAnnotation) Annotation types present on wanted types, annotated with the specific "meta" annotation.annotatedElements(TypeName annotationType) All elements annotated with a specific annotation.annotatedTypes(TypeName annotationType) All types annotated with a specific annotation (including types that inherit such annotation from super types or through interfaces).Annotations available in this round, the collection contains only annotations valid for the extension being invoked.generatedType(TypeName type) Class model builder for a type that is to be code generated.default Collection<ModuleTypeInfo> modules()All modules that are processed in this round.default TypeHierarchyResolverReturns the Java type hierarchy resolver for this processing round.Discover information about the provided type.types()All types that are processed in this round.
-
Method Details
-
addDescriptor
void addDescriptor(TypeName serviceType, TypeName descriptorType, ClassModel.Builder descriptor, double weight, Set<ResolvedType> contracts, Set<ResolvedType> factoryContracts, Object... originatingElements) Add a new service descriptor.- Parameters:
serviceType- type of the service (the implementation class we generate descriptor for)descriptorType- type of the service descriptordescriptor- descriptor class modelweight- weight of this service descriptorcontracts- contracts of this service descriptorfactoryContracts- contracts of the service class if it is a factoryoriginatingElements- possible originating elements (such as Element in APT, or ClassInfo in classpath scanning)- Throws:
IllegalStateException- if an attempt is done to register a new descriptor for the same type
-
serviceContracts
Create service contracts for the provided service that honor configuration of contract discovery.- Parameters:
serviceInfo- type info of the analyzed service- Returns:
- service contracts
-