Class RestChildren.Builder

java.lang.Object
org.apache.juneau.rest.server.RestChildren.Builder
Enclosing class:
RestChildren

public static class RestChildren.Builder extends Object
Builder class.
  • Constructor Details

    • Builder

      protected Builder(RestContext parent, BeanStore beanStore, jakarta.servlet.ServletConfig servletConfig)
      Constructor.
      Parameters:
      parent - The parent RestContext that owns these children. Used for parent-context wiring on dynamically added children. May be null when constructing from contexts already built externally and runtime add/remove is not required.
      beanStore - The bean store used for dependency injection on dynamically added children. Must not be null.
      servletConfig - The ServletConfig passed through to dynamically added child contexts. May be null.
  • Method Details

    • beanStore

      public BeanStore beanStore()
      Returns the bean store used by this builder.
      Returns:
      The bean store used by this builder.
    • add

      Adds an eager child resource to this builder.
      Parameters:
      value - The REST context of the child resource.
      Returns:
      This object.
    • addLazy

      public RestChildren.Builder addLazy(Class<?> resourceClass, String path)
      Registers a lazy child resource entry.

      The path is pre-resolved from the resource class so that routing works immediately at parent startup. The full RestContext is built on the first matching request.

      Delegates to addLazy(RestContext.ResolvedChild, String) with a bare (no-seed) declaration — this public overload's signature is preserved unchanged (it has no external-caller-visible way to express a host-declared @Child seed; see that overload for the seed-carrying entry point used internally by RestContext's childrenDefs discovery).

      Parameters:
      resourceClass - The resource class to materialize lazily. Must not be null.
      path - The pre-resolved path prefix (without leading slash). Use "" to read from @Rest(path) on the resource class.
      Returns:
      This object.
    • build

      public RestChildren build()
      Builds the children.
      Returns:
      A new RestChildren.