Class HttpCodegenValidation
java.lang.Object
io.helidon.declarative.codegen.http.HttpCodegenValidation
HTTP validation utilities used by code generation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<Annotation> firstRequestParamsComponentAnnotation(Collection<Annotation> annotations) Find the first supported request parameter record component annotation.static booleanhasAnnotation(Collection<Annotation> annotations, TypeName annotation) Whether the annotation collection contains the annotation type.static booleanhasMethodParameterAnnotation(Collection<Annotation> annotations) Whether annotations contain a supported endpoint method parameter annotation.static List<TypedElementInfo> requestParamsComponents(TypeInfo requestParamsType) Components of a request parameter record.static TypeInforequestParamsRecordType(Function<TypeName, Optional<TypeInfo>> typeInfoResolver, TypeName requestParamsType, Object originatingElement) Resolve and validate a request parameter record type.static voidvalidateCookieName(String name, String annotationName, Object originatingElement) Validate a cookie parameter name.static voidvalidateMethodParameterAnnotationCount(Collection<Annotation> annotations, String message, Object originatingElement) Validate that endpoint method parameter annotations contain at most one supported request parameter annotation.static voidvalidateRequestParamsBodyComponents(TypeInfo requestParamsType) Validate body parameter rules for a request parameter record.static voidvalidateRequestParamsComponentAnnotationCount(Collection<Annotation> annotations, String message, Object originatingElement) Validate that a request parameter record component contains at most one supported request parameter annotation.
-
Method Details
-
validateMethodParameterAnnotationCount
public static void validateMethodParameterAnnotationCount(Collection<Annotation> annotations, String message, Object originatingElement) Validate that endpoint method parameter annotations contain at most one supported request parameter annotation.- Parameters:
annotations- annotations to inspectmessage- validation failure messageoriginatingElement- originating element
-
hasMethodParameterAnnotation
Whether annotations contain a supported endpoint method parameter annotation.- Parameters:
annotations- annotations to inspect- Returns:
- whether any supported endpoint method parameter annotation is present
-
validateRequestParamsComponentAnnotationCount
public static void validateRequestParamsComponentAnnotationCount(Collection<Annotation> annotations, String message, Object originatingElement) Validate that a request parameter record component contains at most one supported request parameter annotation.- Parameters:
annotations- annotations to inspectmessage- validation failure messageoriginatingElement- originating element
-
firstRequestParamsComponentAnnotation
public static Optional<Annotation> firstRequestParamsComponentAnnotation(Collection<Annotation> annotations) Find the first supported request parameter record component annotation.- Parameters:
annotations- annotations to inspect- Returns:
- first supported request parameter record component annotation
-
hasAnnotation
Whether the annotation collection contains the annotation type.- Parameters:
annotations- annotations to inspectannotation- annotation type- Returns:
- whether the annotation collection contains the annotation type
-
requestParamsRecordType
public static TypeInfo requestParamsRecordType(Function<TypeName, Optional<TypeInfo>> typeInfoResolver, TypeName requestParamsType, Object originatingElement) Resolve and validate a request parameter record type.- Parameters:
typeInfoResolver- type info resolverrequestParamsType- request parameter typeoriginatingElement- originating element- Returns:
- resolved request parameter record type
-
validateRequestParamsBodyComponents
Validate body parameter rules for a request parameter record.- Parameters:
requestParamsType- request parameter record type
-
requestParamsComponents
Components of a request parameter record.- Parameters:
requestParamsType- request parameter record type- Returns:
- record components
-
validateCookieName
-