Class HttpCodegenValidation

java.lang.Object
io.helidon.declarative.codegen.http.HttpCodegenValidation

public final class HttpCodegenValidation extends Object
HTTP validation utilities used by code generation.
  • 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 inspect
      message - validation failure message
      originatingElement - originating element
    • hasMethodParameterAnnotation

      public static boolean hasMethodParameterAnnotation(Collection<Annotation> annotations)
      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 inspect
      message - validation failure message
      originatingElement - 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

      public static boolean hasAnnotation(Collection<Annotation> annotations, TypeName annotation)
      Whether the annotation collection contains the annotation type.
      Parameters:
      annotations - annotations to inspect
      annotation - 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 resolver
      requestParamsType - request parameter type
      originatingElement - originating element
      Returns:
      resolved request parameter record type
    • validateRequestParamsBodyComponents

      public static void validateRequestParamsBodyComponents(TypeInfo requestParamsType)
      Validate body parameter rules for a request parameter record.
      Parameters:
      requestParamsType - request parameter record type
    • requestParamsComponents

      public static List<TypedElementInfo> requestParamsComponents(TypeInfo requestParamsType)
      Components of a request parameter record.
      Parameters:
      requestParamsType - request parameter record type
      Returns:
      record components
    • validateCookieName

      public static void validateCookieName(String name, String annotationName, Object originatingElement)
      Validate a cookie parameter name.
      Parameters:
      name - cookie parameter name
      annotationName - annotation name for diagnostics
      originatingElement - originating element