Class AbstractRestBuilder<R,SELF extends AbstractRestBuilder<R,SELF>>
- Type Parameters:
R- The resource type produced bybuild().SELF- The concrete builder type (self type).
- All Implemented Interfaces:
RestBuilder<SELF>
- Direct Known Subclasses:
RestMixin.Builder,RestResource.Builder,RestServlet.Builder
RestBuilder flavor builders (RestServlet.Builder,
RestResource.Builder, RestMixin.Builder).
Each fluent @Rest-member setter is implemented once here and forwards into a backing
RestAnnotation.Builder — the override bag. At RestContext construction time the bag is
turned into a synthetic, highest-priority @Rest annotation that is prepended to the resource's
@Rest chain, so builder-supplied values take precedence over the class's own
@Rest annotation values.
Self type (CRTP):
SELF is the concrete builder type, left open through the flavor builders and their user subclasses so
that bespoke setters on a subclass chain with true covariant returns. Setters return self().
- Since:
- 10.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowedHeaderParams(String value) Specifies theallowedHeaderParamsfor this resource.allowedMethodHeaders(String value) Specifies theallowedMethodHeadersfor this resource.allowedMethodParams(String value) Specifies theallowedMethodParamsfor this resource.allowedParserOptions(String... value) Specifies theallowedParserOptionsfor this resource.allowedSerializerOptions(String... value) Specifies theallowedSerializerOptionsfor this resource.asyncCompletionExecutor(String value) Specifies theasyncCompletionExecutorbean name for this resource.asyncTimeoutMillis(String value) Specifies theasyncTimeoutMillisfor this resource.abstract Rbuild()Builds the configured resource instance.Specifies thechild resourcesfor this resource.clientVersionHeader(String value) Specifies theclientVersionHeaderfor this resource.Specifies theconfiglocation for this resource.Specifies theconsumesmedia types for this resource.converters(Class<? extends RestConverter>... value) Specifies theconvertersfor this resource.protected RReflectively instantiates the resource type, preferring a(RestBuilder<?>)constructor (constructor injection) and falling back to the no-arg constructor.debugMarshalling(String value) Specifies thedebugMarshallingflag for this resource.defaultAccept(String value) Specifies thedefaultAcceptfor this resource.defaultCharset(String value) Specifies thedefaultCharsetfor this resource.defaultContentType(String value) Specifies thedefaultContentTypefor this resource.defaultRequestAttributes(String... value) Specifies thedefaultRequestAttributesfor this resource.defaultRequestHeaders(String... value) Specifies thedefaultRequestHeadersfor this resource.defaultResponseHeaders(String... value) Specifies thedefaultResponseHeadersfor this resource.description(String... value) Specifies thedescriptionfor this resource.disableContentParam(String value) Specifies thedisableContentParamflag for this resource.Specifies theeagerInitflag for this resource.Specifies theencodersfor this resource.Returns the forward-compat extras set viaset(String, Object).Returns the programmatic MDC async-propagation override, ornull if not set.Class<?>Returns the resource type produced by this builder.Specifies theguardsfor this resource.lazyChildren(String value) Specifies thelazyChildrenflag for this resource.Specifies themaxInputfor this resource.mdcAsyncPropagation(boolean value) Specifies whether MDC async propagation is enabled for this resource.Specifies themessagesbundle location for this resource.Specifies themixinDefs(rich, host-overriding mixin definitions) for this resource.Specifies themixinsfor this resource.Specifies thenoInheritproperty names for this resource.observability(String value) Specifies theobservabilityflag for this resource.openApiProvider(Class<? extends OpenApiProvider> value) Specifies theopenApiProviderfor this resource.Specifies theparsersfor this resource.partParser(Class<? extends HttpPartParser> value) Specifies thepartParserfor this resource.partSerializer(Class<? extends HttpPartSerializer> value) Specifies thepartSerializerfor this resource.Specifies thepathfor this resource.Specifies thetop-level mount pathsfor this resource.problemDetails(String value) Specifies theproblemDetailsflag for this resource.Specifies theproducesmedia types for this resource.renderResponseStackTraces(String value) Specifies therenderResponseStackTracesflag for this resource.responseProcessors(Class<? extends ResponseProcessor>... value) Specifies theresponseProcessorsfor this resource.restOpArgs(Class<? extends RestOpArg>... value) Specifies therestOpArgsfor this resource.Specifies theroleGuardfor this resource.rolesDeclared(String value) Specifies therolesDeclaredfor this resource.protected final SELFself()Returns this builder cast to the self type.serializers(Class<? extends Serializer>... value) Specifies theserializersfor this resource.Generic forward-compatible override setter, keyed by the@Restproperty name (e.g.Specifies thesiteNamefor this resource.staticFiles(Class<? extends StaticFiles> value) Specifies thestaticFilesfor this resource.swaggerProvider(Class<? extends SwaggerProvider> value) Specifies theswaggerProviderfor this resource.Specifies thetitlefor this resource.Returns the synthetic@Restannotation carrying all builder-set members, for use as the highest-priority contributor of the@Restresolution chain.uriAuthority(String value) Specifies theuriAuthorityfor this resource.uriContext(String value) Specifies theuriContextfor this resource.uriRelativity(String value) Specifies theuriRelativityfor this resource.uriResolution(String value) Specifies theuriResolutionfor this resource.virtualThreads(String value) Specifies thevirtualThreadsflag for this resource.
-
Constructor Details
-
AbstractRestBuilder
Constructor.- Parameters:
resourceType- The resource type produced bybuild(). Must not benull .
-
-
Method Details
-
self
Returns this builder cast to the self type.- Returns:
- This object.
-
build
Builds the configured resource instance.- Returns:
- A new resource instance configured by this builder.
-
createResource
Reflectively instantiates the resource type, preferring a(RestBuilder<?>)constructor (constructor injection) and falling back to the no-arg constructor.Flavor builder
build()implementations call this then stashthison the returned instance.- Returns:
- A new, uninitialized resource instance.
-
getResourceType
Returns the resource type produced by this builder.- Returns:
- The resource type. Never
null .
-
toRestAnnotation
Returns the synthetic@Restannotation carrying all builder-set members, for use as the highest-priority contributor of the@Restresolution chain.- Returns:
- The synthetic annotation. Never
null .
-
getMdcAsyncPropagation
Returns the programmatic MDC async-propagation override, ornull if not set.- Returns:
- The override, or
null if not set.
-
getExtras
Returns the forward-compat extras set viaset(String, Object).- Returns:
- An unmodifiable view of the extras map. Never
null .
-
path
Description copied from interface:RestBuilderSpecifies thepathfor this resource.- Specified by:
pathin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
paths
Description copied from interface:RestBuilderSpecifies thetop-level mount pathsfor this resource.- Specified by:
pathsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
children
Description copied from interface:RestBuilderSpecifies thechild resourcesfor this resource.- Specified by:
childrenin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
mixins
Description copied from interface:RestBuilderSpecifies themixinsfor this resource.- Specified by:
mixinsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
mixinDefs
Description copied from interface:RestBuilderSpecifies themixinDefs(rich, host-overriding mixin definitions) for this resource.- Specified by:
mixinDefsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
uriAuthority
Description copied from interface:RestBuilderSpecifies theuriAuthorityfor this resource.- Specified by:
uriAuthorityin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
uriContext
Description copied from interface:RestBuilderSpecifies theuriContextfor this resource.- Specified by:
uriContextin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
uriRelativity
Description copied from interface:RestBuilderSpecifies theuriRelativityfor this resource.- Specified by:
uriRelativityin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
uriResolution
Description copied from interface:RestBuilderSpecifies theuriResolutionfor this resource.- Specified by:
uriResolutionin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
serializers
Description copied from interface:RestBuilderSpecifies theserializersfor this resource.- Specified by:
serializersin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
parsers
Description copied from interface:RestBuilderSpecifies theparsersfor this resource.- Specified by:
parsersin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
encoders
Description copied from interface:RestBuilderSpecifies theencodersfor this resource.- Specified by:
encodersin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
partSerializer
Description copied from interface:RestBuilderSpecifies thepartSerializerfor this resource.- Specified by:
partSerializerin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
partParser
Description copied from interface:RestBuilderSpecifies thepartParserfor this resource.- Specified by:
partParserin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
consumes
Description copied from interface:RestBuilderSpecifies theconsumesmedia types for this resource.- Specified by:
consumesin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
produces
Description copied from interface:RestBuilderSpecifies theproducesmedia types for this resource.- Specified by:
producesin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
responseProcessors
Description copied from interface:RestBuilderSpecifies theresponseProcessorsfor this resource.- Specified by:
responseProcessorsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
allowedSerializerOptions
Description copied from interface:RestBuilderSpecifies theallowedSerializerOptionsfor this resource.- Specified by:
allowedSerializerOptionsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
allowedParserOptions
Description copied from interface:RestBuilderSpecifies theallowedParserOptionsfor this resource.- Specified by:
allowedParserOptionsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
allowedHeaderParams
Description copied from interface:RestBuilderSpecifies theallowedHeaderParamsfor this resource.- Specified by:
allowedHeaderParamsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
allowedMethodHeaders
Description copied from interface:RestBuilderSpecifies theallowedMethodHeadersfor this resource.- Specified by:
allowedMethodHeadersin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
allowedMethodParams
Description copied from interface:RestBuilderSpecifies theallowedMethodParamsfor this resource.- Specified by:
allowedMethodParamsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
clientVersionHeader
Description copied from interface:RestBuilderSpecifies theclientVersionHeaderfor this resource.- Specified by:
clientVersionHeaderin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
defaultAccept
Description copied from interface:RestBuilderSpecifies thedefaultAcceptfor this resource.- Specified by:
defaultAcceptin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
defaultContentType
Description copied from interface:RestBuilderSpecifies thedefaultContentTypefor this resource.- Specified by:
defaultContentTypein interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
defaultCharset
Description copied from interface:RestBuilderSpecifies thedefaultCharsetfor this resource.- Specified by:
defaultCharsetin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
defaultRequestAttributes
Description copied from interface:RestBuilderSpecifies thedefaultRequestAttributesfor this resource.- Specified by:
defaultRequestAttributesin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
defaultRequestHeaders
Description copied from interface:RestBuilderSpecifies thedefaultRequestHeadersfor this resource.- Specified by:
defaultRequestHeadersin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
defaultResponseHeaders
Description copied from interface:RestBuilderSpecifies thedefaultResponseHeadersfor this resource.- Specified by:
defaultResponseHeadersin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
disableContentParam
Description copied from interface:RestBuilderSpecifies thedisableContentParamflag for this resource.- Specified by:
disableContentParamin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
maxInput
Description copied from interface:RestBuilderSpecifies themaxInputfor this resource.- Specified by:
maxInputin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
restOpArgs
Description copied from interface:RestBuilderSpecifies therestOpArgsfor this resource.- Specified by:
restOpArgsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
guards
Description copied from interface:RestBuilderSpecifies theguardsfor this resource.- Specified by:
guardsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
roleGuard
Description copied from interface:RestBuilderSpecifies theroleGuardfor this resource.- Specified by:
roleGuardin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
rolesDeclared
Description copied from interface:RestBuilderSpecifies therolesDeclaredfor this resource.- Specified by:
rolesDeclaredin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
converters
Description copied from interface:RestBuilderSpecifies theconvertersfor this resource.- Specified by:
convertersin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
eagerInit
Description copied from interface:RestBuilderSpecifies theeagerInitflag for this resource.- Specified by:
eagerInitin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
lazyChildren
Description copied from interface:RestBuilderSpecifies thelazyChildrenflag for this resource.- Specified by:
lazyChildrenin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
virtualThreads
Description copied from interface:RestBuilderSpecifies thevirtualThreadsflag for this resource.- Specified by:
virtualThreadsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
asyncTimeoutMillis
Description copied from interface:RestBuilderSpecifies theasyncTimeoutMillisfor this resource.- Specified by:
asyncTimeoutMillisin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
asyncCompletionExecutor
Description copied from interface:RestBuilderSpecifies theasyncCompletionExecutorbean name for this resource.- Specified by:
asyncCompletionExecutorin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
observability
Description copied from interface:RestBuilderSpecifies theobservabilityflag for this resource.- Specified by:
observabilityin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
renderResponseStackTraces
Description copied from interface:RestBuilderSpecifies therenderResponseStackTracesflag for this resource.- Specified by:
renderResponseStackTracesin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
problemDetails
Description copied from interface:RestBuilderSpecifies theproblemDetailsflag for this resource.- Specified by:
problemDetailsin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
debugMarshalling
Description copied from interface:RestBuilderSpecifies thedebugMarshallingflag for this resource.- Specified by:
debugMarshallingin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
title
Description copied from interface:RestBuilderSpecifies thetitlefor this resource.- Specified by:
titlein interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
description
Description copied from interface:RestBuilderSpecifies thedescriptionfor this resource.- Specified by:
descriptionin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
siteName
Description copied from interface:RestBuilderSpecifies thesiteNamefor this resource.- Specified by:
siteNamein interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
swaggerProvider
Description copied from interface:RestBuilderSpecifies theswaggerProviderfor this resource.- Specified by:
swaggerProviderin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
openApiProvider
Description copied from interface:RestBuilderSpecifies theopenApiProviderfor this resource.- Specified by:
openApiProviderin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
messages
Description copied from interface:RestBuilderSpecifies themessagesbundle location for this resource.- Specified by:
messagesin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
config
Description copied from interface:RestBuilderSpecifies theconfiglocation for this resource.- Specified by:
configin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
staticFiles
Description copied from interface:RestBuilderSpecifies thestaticFilesfor this resource.- Specified by:
staticFilesin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
noInherit
Description copied from interface:RestBuilderSpecifies thenoInheritproperty names for this resource.- Specified by:
noInheritin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
mdcAsyncPropagation
Description copied from interface:RestBuilderSpecifies whether MDC async propagation is enabled for this resource.This is a programmatic-only knob — it has no
@Restannotation member (its default is env-driven). Setting it here overrides theRestContext.mdcAsyncPropagationenv-driven default.- Specified by:
mdcAsyncPropagationin interfaceRestBuilder<R>- Parameters:
value- The new value for this property.- Returns:
- This object.
-
set
Description copied from interface:RestBuilderGeneric forward-compatible override setter, keyed by the@Restproperty name (e.g."allowContentParam","defaultRequestHeaders").Use this escape hatch for members not yet exposed as a dedicated fluent method. Keys reuse the existing
@Restmember names.- Specified by:
setin interfaceRestBuilder<R>- Parameters:
key- The@Restproperty name. Must not benull .value- The override value.- Returns:
- This object.
-