Package org.apache.juneau.rest.server
Class RestChildren.Builder
java.lang.Object
org.apache.juneau.rest.server.RestChildren.Builder
- Enclosing class:
- RestChildren
Builder class.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder(RestContext parent, BeanStore beanStore, jakarta.servlet.ServletConfig servletConfig) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionadd(RestContext value) Adds an eager child resource to this builder.Registers a lazy child resource entry.Returns the bean store used by this builder.build()Builds the children.
-
Constructor Details
-
Builder
protected Builder(RestContext parent, BeanStore beanStore, jakarta.servlet.ServletConfig servletConfig) Constructor.- Parameters:
parent- The parentRestContextthat owns these children. Used for parent-context wiring on dynamically added children. May benullwhen 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 benull.servletConfig- TheServletConfigpassed through to dynamically added child contexts. May benull.
-
-
Method Details
-
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
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
RestContextis 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@Childseed; see that overload for the seed-carrying entry point used internally byRestContext'schildrenDefsdiscovery).- Parameters:
resourceClass- The resource class to materialize lazily. Must not benull.path- The pre-resolved path prefix (without leading slash). Use""to read from@Rest(path)on the resource class.- Returns:
- This object.
-
build
Builds the children.- Returns:
- A new
RestChildren.
-