Class RestContextProperties

java.lang.Object
org.apache.juneau.rest.server.RestContextProperties

@ConfigProperties(prefix="RestContext") public class RestContextProperties extends Object
The env-driven RestContext.* default properties for a resource, resolved as a single bound object.

Each property supplies the environment-level default for the corresponding @Rest attribute (for example getClientVersionHeader() backs @Rest(clientVersionHeader)). A resource's @Rest annotation values, when present, take precedence over these defaults; these properties only establish the starting value before the annotation chain is applied.

Values are resolved under the RestContext prefix from the standard Settings source chain (thread-local override, global override, registered property sources, system properties, system environment) as well as any per-resource PropertySource beans registered in the resource's bean store — so a resource's @Rest(config=...) file can set a RestContext.* key and have it take effect. Relaxed key matching is enabled, so a key may be spelled in camelCase, dotted, or SCREAMING_SNAKE_CASE form.

A key absent from every source leaves the corresponding property at its default value shown below. The bound instance for a resource is retrievable via RestContext.getRestContextProperties() or from the resource bean store via beanStore().getBean(RestContextProperties.class).

The RestContext.uriAuthority and RestContext.uriContext settings are intentionally not part of this bean: they carry a null-versus-empty distinction that is represented separately on RestContext. The juneau.restLogger.level setting is likewise separate, as it is owned by the call-logger subsystem rather than RestContext.

See Also:
Since:
10.0.0
  • Constructor Details

  • Method Details

    • getAllowedHeaderParams

      The default set of header names that may be passed via URL query parameter (@Rest(allowedHeaderParams)).
      Returns:
      The comma-delimited value. Never null.
    • getAllowedMethodHeaders

      The default set of HTTP method names that may be specified via a request header (@Rest(allowedMethodHeaders)).
      Returns:
      The comma-delimited value. Never null.
    • getAllowedMethodParams

      The default set of HTTP method names that may be specified via URL query parameter (@Rest(allowedMethodParams)).
      Returns:
      The comma-delimited value. Never null.
    • getDisableContentParamRaw

      The raw (unresolved) @Rest(disableContentParam) default — whether the &content= URL parameter is disabled.

      The value is stored verbatim — without SVL variable resolution or boolean conversion — because SVL resolution requires the resource's var resolver, which this bean does not carry. RestContext reads this raw value, resolves any SVL variables, and parses it to a boolean.

      Returns:
      The raw value. Never null.
    • getRenderResponseStackTracesRaw

      The raw (unresolved) @Rest(renderResponseStackTraces) default — whether stack traces are rendered in error responses.

      Stored verbatim; RestContext owns SVL resolution and boolean parsing (see getDisableContentParamRaw()).

      Returns:
      The raw value. Never null.
    • getProblemDetailsRaw

      The raw (unresolved) @Rest(problemDetails) default — whether RFC 7807 application/problem+json responses are emitted.

      Stored verbatim; RestContext owns SVL resolution and boolean parsing (see getDisableContentParamRaw()).

      Returns:
      The raw value. Never null.
    • getDebugMarshallingRaw

      The raw (unresolved) @Rest(debugMarshalling) default — whether REST-driven serializer/parser debug behavior is enabled.

      Stored verbatim; RestContext owns SVL resolution and boolean parsing (see getDisableContentParamRaw()).

      Returns:
      The raw value. Never null.
    • getVirtualThreadsRaw

      The raw (unresolved) @Rest(virtualThreads) default — whether per-request virtual-thread dispatch is opted into on Java 21+.

      Stored verbatim; RestContext owns SVL resolution and boolean parsing (see getDisableContentParamRaw()).

      Returns:
      The raw value. Never null.
    • getResponseTraceparentRaw

      The raw (unresolved) default controlling whether the server writes W3C traceparent / tracestate response headers when a tracer is active. Defaults to "true".

      Stored verbatim; RestContext owns SVL resolution and boolean parsing (see getDisableContentParamRaw()).

      Returns:
      The raw value. Never null.
    • getMdcAsyncPropagationRaw

      The raw (unresolved) default controlling whether the request thread's SLF4J MDC map is propagated to asynchronous completion threads. Defaults to "true".

      Stored verbatim; RestContext owns SVL resolution and boolean parsing (see getDisableContentParamRaw()).

      Returns:
      The raw value. Never null.
    • getEagerInitRaw

      The raw (unresolved) @Rest(eagerInit) default — whether framework beans are force-initialized during construction.

      Stored verbatim; RestContext owns SVL resolution and boolean parsing (see getDisableContentParamRaw()).

      Returns:
      The raw value. Never null.
    • getLazyChildrenRaw

      The raw (unresolved) @Rest(lazyChildren) default — whether child-context construction is deferred.

      Stored verbatim; RestContext owns SVL resolution and boolean parsing (see getDisableContentParamRaw()).

      Returns:
      The raw value. Never null.
    • getClientVersionHeader

      The default request header used for client-version matching (@Rest(clientVersionHeader)).
      Returns:
      The value. Never null.
    • getUriRelativityRaw

      The raw (unresolved) @Rest(uriRelativity) default value. Blank means unset.

      The value is stored verbatim — without SVL variable resolution or enum conversion — because SVL resolution requires the resource's var resolver, which this bean does not carry. RestContext reads this raw value, resolves any SVL variables, and applies lenient enum parsing.

      Returns:
      The raw value. Never null.
    • getUriResolutionRaw

      The raw (unresolved) @Rest(uriResolution) default value. Blank means unset.

      The value is stored verbatim — without SVL variable resolution or enum conversion — because SVL resolution requires the resource's var resolver, which this bean does not carry. RestContext reads this raw value, resolves any SVL variables, and applies lenient enum parsing.

      Returns:
      The raw value. Never null.