From c49ce14e89c3ae5a9717570d160e608ea1ef3270 Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Mon, 4 Nov 2024 18:13:59 +0100 Subject: [PATCH 01/23] Small fixes and pre-requisite changes. --- .../common/types/ElementSignature.java | 33 +++++++++++++++++++ .../service/codegen/DescriptorClassCode.java | 22 +++++++++++++ .../codegen/GenerateServiceDescriptor.java | 12 +++---- .../service/inject/api/LookupSupport.java | 12 +++++++ .../codegen/EventEmitterObserverProvider.java | 2 +- .../service/inject/InjectConfigBlueprint.java | 11 +++++++ 6 files changed, 85 insertions(+), 7 deletions(-) diff --git a/common/types/src/main/java/io/helidon/common/types/ElementSignature.java b/common/types/src/main/java/io/helidon/common/types/ElementSignature.java index a167313516d..6e045d1c970 100644 --- a/common/types/src/main/java/io/helidon/common/types/ElementSignature.java +++ b/common/types/src/main/java/io/helidon/common/types/ElementSignature.java @@ -45,6 +45,39 @@ public sealed interface ElementSignature permits ElementSignatures.FieldSignatur ElementSignatures.MethodSignature, ElementSignatures.ParameterSignature, ElementSignatures.NoSignature { + /** + * A field signature. + * + * @param type type of the field + * @param name name of the field + * @return a new field signature + */ + static ElementSignature createField(TypeName type, String name) { + return ElementSignatures.createField(type, name); + } + + /** + * A constructor signature. + * + * @param parameters list of types of parameters + * @return a new constructor signature + */ + static ElementSignature createConstructor(List parameters) { + return ElementSignatures.createConstructor(parameters); + } + + /** + * A method signature. + * + * @param returnType return type of the method + * @param name name of the method + * @param parameters parameter types of the method + * @return a new method signature + */ + static ElementSignature createMethod(TypeName returnType, String name, List parameters) { + return ElementSignatures.createMethod(returnType, name, parameters); + } + /** * Type of the element. Resolves as follows: *