Annotation Interface Child


@Target({}) @Retention(RUNTIME) public @interface Child
Host-side setting seed for the @Rest(childrenDefs=...) attribute.

Declares a routed child class and lets the host seed a curated set of @Rest-level settings onto that child's otherwise-isolated RestContext — the child-resource analog of @Rest(mixinDefs=...). This is the host-side complement to @Rest(children=...) (which takes bare classes and offers no seed hook).

Example:

@Rest( childrenDefs=@Child(type=FooChild.class, maxInput="10M") ) public class MyResource { ... }

Seed semantics

Unlike @Mixin overrides (which win over an inherited chain), children are isolated from the host's resolution chain by design, so a @Child seed doesn't override anything — it seeds settings onto an otherwise-isolated child context:

  • Additive-security (guards, converters, roleGuard, rolesDeclared) — the host contributes, the child can't remove or weaken it (list-shaped members prepend; the two role-based members AND-stack alongside the child's own value).
  • Child-wins scalars (partSerializer, partParser, defaultCharset, maxInput) — the seed is a default/fallback; the child's own explicit @Rest declaration wins when present.

A child's own @Rest(noInherit="<property>") cuts the corresponding @Child seed too, for both buckets above — the child always stays in full control of its own configuration.

There is no noInherit() member on @Child itself (nothing to cut in an isolated context), and no path()/paths() re-mount member (the child's own @Rest(path) stays authoritative).

See Also:
Since:
10.0.0
  • Element Details

    • type

      The child class to route.

      Required. Equivalent to a bare entry in Rest.children(), but with the seed slots below.

      Returns:
      The child class.
    • guards

      Class<? extends RestGuard>[] guards
      Host-seeded guards for this child's endpoints (prepended before the child's own).
      Returns:
      The annotation value.
      Default:
      {}
    • converters

      Host-seeded converters for this child's endpoints (prepended before the child's own).
      Returns:
      The annotation value.
      Default:
      {}
    • roleGuard

      Host-seeded roleGuard for this child's endpoints (AND-stacks with the child's own).
      Returns:
      The annotation value.
      Default:
      ""
    • rolesDeclared

      Host-seeded rolesDeclared for this child's endpoints (AND-stacks with the child's own).
      Returns:
      The annotation value.
      Default:
      ""
    • partSerializer

      Host-seeded partSerializer default for this child's endpoints.
      Returns:
      The annotation value.
      Default:
      org.apache.juneau.marshall.httppart.HttpPartSerializer.Void.class
    • partParser

      Host-seeded partParser default for this child's endpoints.
      Returns:
      The annotation value.
      Default:
      org.apache.juneau.marshall.httppart.HttpPartParser.Void.class
    • defaultCharset

      Host-seeded defaultCharset default for this child's endpoints.
      Returns:
      The annotation value.
      Default:
      ""
    • maxInput

      Host-seeded maxInput default for this child's endpoints.
      Returns:
      The annotation value.
      Default:
      ""