-
public interface Feature
A feature extension contract. Typically encapsulates a concept or facility that involves configuration of multiple providers (e.g. filters or interceptors) and/or properties.A
Feature
is a special type of JAX-RS configuration meta-provider. Once a feature is registered, it'sconfigure(FeatureContext)
method is invoked during JAX-RS runtime configuration and bootstrapping phase allowing the feature to further configure the runtime context in which it has been registered. From within the invokedconfigure(...)
method a feature may provide additional runtime configuration for the facility or conceptual domain it represents, such as registering additional contract providers, including nested features and/or specifying domain-specific properties.- Since:
- 2.0
- Author:
- Marek Potociar
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description boolean
configure(FeatureContext context)
A call-back method called when the feature is to be enabled in a given runtime configuration scope.
-
-
-
Method Detail
-
configure
boolean configure(FeatureContext context)
A call-back method called when the feature is to be enabled in a given runtime configuration scope. The responsibility of the feature is to properly update the supplied runtime configuration context and returntrue
if the feature was successfully enabled orfalse
otherwise.Note that under some circumstances the feature may decide not to enable itself, which is indicated by returning
false
. In such case the configuration context does not add the feature to the collection of enabled features and a subsequent call toConfiguration.isEnabled(Feature)
orConfiguration.isEnabled(Class)
method would returnfalse
.- Parameters:
context
- configurable context in which the feature should be enabled.- Returns:
true
if the feature was successfully enabled,false
otherwise.
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/ws/rs/core/feature.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.