Class NavigationMixin
[GET /]) that lists the host resource's child
resources.
Single-responsibility op-mixin carved out of the former BasicGroupOperations interface (and the
concrete getChildren(...) method previously kept on the Basic*Group base classes). The
navigation page renders one entry per @Rest(children) resource declared on the
host.
Reaching the host's children:
A mixin's @RestOp methods are bound to a per-mixin RestContext sub-context that has no
children of its own, so this op resolves the host's children via getHostContext().getRestChildren() rather than against the mixin's own (empty) context. Because
getHostContext() is backed by the sub-context's already-populated parent linkage, this works
whether the mixin is composed onto a servlet host or a child-resource host.
Page decoration:
Per the mixin sub-context inheritance model, the navigation page inherits the host's class-level
@HtmlDocConfig page decoration (navigation links,
etc.), so the rendered HTML matches the host's other endpoints.
Composition example:
See Also:
- Since:
- 10.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.rest.server.servlet.RestMixin
RestMixin.Builder<R extends RestMixin,SELF extends RestMixin.Builder<R, SELF>>, RestMixin.DefaultBuilder<R extends RestMixin> -
Constructor Summary
ConstructorsConstructorDescriptionNo-arg constructor — navigation has no configurable state. -
Method Summary
Methods inherited from class org.apache.juneau.rest.server.servlet.RestMixin
builder, getHostContext, getRestBuilder, setContext
-
Constructor Details
-
NavigationMixin
public NavigationMixin()No-arg constructor — navigation has no configurable state.
-
-
Method Details
-
getChildren
[GET /] - Get child resources.Returns a bean that lists and allows navigation to the host resource's child resources, resolved against the host context so the listing reflects the host's children rather than the mixin's own (empty) sub-context.
- Parameters:
req- The HTTP request.- Returns:
- The bean containing links to the child resources.
-