Class RestContextProperties
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe default set of header names that may be passed via URL query parameter (@Rest(allowedHeaderParams)).The default set of HTTP method names that may be specified via a request header (@Rest(allowedMethodHeaders)).The default set of HTTP method names that may be specified via URL query parameter (@Rest(allowedMethodParams)).The default request header used for client-version matching (@Rest(clientVersionHeader)).The raw (unresolved)@Rest(debugMarshalling)default — whether REST-driven serializer/parser debug behavior is enabled.The raw (unresolved)@Rest(disableContentParam)default — whether the&content=URL parameter is disabled.The raw (unresolved)@Rest(eagerInit)default — whether framework beans are force-initialized during construction.The raw (unresolved)@Rest(lazyChildren)default — whether child-context construction is deferred.The raw (unresolved) default controlling whether the request thread's SLF4J MDC map is propagated to asynchronous completion threads.The raw (unresolved)@Rest(problemDetails)default — whether RFC 7807application/problem+jsonresponses are emitted.The raw (unresolved)@Rest(renderResponseStackTraces)default — whether stack traces are rendered in error responses.The raw (unresolved) default controlling whether the server writes W3Ctraceparent/tracestateresponse headers when a tracer is active.The raw (unresolved)@Rest(uriRelativity)default value.The raw (unresolved)@Rest(uriResolution)default value.The raw (unresolved)@Rest(virtualThreads)default — whether per-request virtual-thread dispatch is opted into on Java 21+.
-
Constructor Details
-
RestContextProperties
public RestContextProperties()
-
-
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.
RestContextreads 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;
RestContextowns SVL resolution and boolean parsing (seegetDisableContentParamRaw()).- Returns:
- The raw value. Never
null .
-
getProblemDetailsRaw
The raw (unresolved)@Rest(problemDetails)default — whether RFC 7807application/problem+jsonresponses are emitted.Stored verbatim;
RestContextowns SVL resolution and boolean parsing (seegetDisableContentParamRaw()).- Returns:
- The raw value. Never
null .
-
getDebugMarshallingRaw
The raw (unresolved)@Rest(debugMarshalling)default — whether REST-driven serializer/parser debug behavior is enabled.Stored verbatim;
RestContextowns SVL resolution and boolean parsing (seegetDisableContentParamRaw()).- 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;
RestContextowns SVL resolution and boolean parsing (seegetDisableContentParamRaw()).- Returns:
- The raw value. Never
null .
-
getResponseTraceparentRaw
The raw (unresolved) default controlling whether the server writes W3Ctraceparent/tracestateresponse headers when a tracer is active. Defaults to"true".Stored verbatim;
RestContextowns SVL resolution and boolean parsing (seegetDisableContentParamRaw()).- 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;
RestContextowns SVL resolution and boolean parsing (seegetDisableContentParamRaw()).- Returns:
- The raw value. Never
null .
-
getEagerInitRaw
The raw (unresolved)@Rest(eagerInit)default — whether framework beans are force-initialized during construction.Stored verbatim;
RestContextowns SVL resolution and boolean parsing (seegetDisableContentParamRaw()).- Returns:
- The raw value. Never
null .
-
getLazyChildrenRaw
The raw (unresolved)@Rest(lazyChildren)default — whether child-context construction is deferred.Stored verbatim;
RestContextowns SVL resolution and boolean parsing (seegetDisableContentParamRaw()).- 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.
RestContextreads 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.
RestContextreads this raw value, resolves any SVL variables, and applies lenient enum parsing.- Returns:
- The raw value. Never
null .
-