Enum Class HttpAccess

java.lang.Object
java.lang.Enum<HttpAccess>
org.ek9lang.compiler.support.HttpAccess
All Implemented Interfaces:
Serializable, Comparable<HttpAccess>, Constable

public enum HttpAccess extends Enum<HttpAccess>
THE HTTP access kind of a service operation's parameter: where in the request its value comes from. The six constants are exactly the words of the grammar's httpAccess rule, in its order, and each constant's NAME is the text the lexer reads, the text stored on the parameter (the HTTP_ACCESS squirrel), the text carried in the IR (ServiceRouteDetails.ParamBinding) and the text the run time reports in a bad-request response - so the front end, the IR and the back end switch on this type and a rename can no longer compile clean and break route binding (F14, 2026-10-20: it was seven string compares in phase 2, one in phase 7 and bare case "PATH" literals in the JVM back end).

HttpAccessTest ties every constant to a lexer token and every token to a constant.

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The request body - cannot be qualified.
    The HTTPContext - cannot be qualified.
    A header value; the source is its name.
    A variable of the URI path ({id}); the source is its name.
    A query-string value; the source is its name.
    The whole HTTPRequest - cannot be qualified.
  • Method Summary

    Modifier and Type
    Method
    Description
    The access kind stored on this parameter, or empty if none has been stored yet.
    static void
    THE defaulting of a service parameter that declares no access: it is a PATH parameter bound to the placeholder of its own name.
    boolean
    True for the kinds that name a value to extract (PATH, QUERY, HEADER) and so need a source name; the others cannot be qualified.
    static HttpAccess
    of(ISymbol param)
    The access kind of this parameter: what was stored, else PATH - the kind an unqualified service parameter is assumed to be (see defaultOnto(ISymbol)), so a check that runs without having asked for the default first still gets the answer the default would have given.
    parse(String text)
    The access kind a text names, or empty when it is not one of the six words.
    void
    putOn(ISymbol param)
    Store this access kind on the parameter, as the one writer of the HTTP_ACCESS squirrel.
    static HttpAccess
    Returns the enum constant of this class with the specified name.
    static HttpAccess[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • PATH

      public static final HttpAccess PATH
      A variable of the URI path ({id}); the source is its name.
    • QUERY

      public static final HttpAccess QUERY
      A query-string value; the source is its name.
    • REQUEST

      public static final HttpAccess REQUEST
      The whole HTTPRequest - cannot be qualified.
    • CONTENT

      public static final HttpAccess CONTENT
      The request body - cannot be qualified.
    • CONTEXT

      public static final HttpAccess CONTEXT
      The HTTPContext - cannot be qualified.
  • Method Details

    • values

      public static HttpAccess[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HttpAccess valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • needsSource

      public boolean needsSource()
      True for the kinds that name a value to extract (PATH, QUERY, HEADER) and so need a source name; the others cannot be qualified.
    • parse

      public static Optional<HttpAccess> parse(String text)
      The access kind a text names, or empty when it is not one of the six words.
    • accessOf

      public static Optional<HttpAccess> accessOf(ISymbol param)
      The access kind stored on this parameter, or empty if none has been stored yet.
    • of

      public static HttpAccess of(ISymbol param)
      The access kind of this parameter: what was stored, else PATH - the kind an unqualified service parameter is assumed to be (see defaultOnto(ISymbol)), so a check that runs without having asked for the default first still gets the answer the default would have given.
    • putOn

      public void putOn(ISymbol param)
      Store this access kind on the parameter, as the one writer of the HTTP_ACCESS squirrel.
    • defaultOnto

      public static void defaultOnto(ISymbol param)
      THE defaulting of a service parameter that declares no access: it is a PATH parameter bound to the placeholder of its own name. That is an assumption - the checks that follow test the path really has it. A PATH parameter that declares no source takes its own name as the source.