Interface ModelProcessor
-
- All Known Implementing Classes:
OptionsMethodProcessor,WadlModelProcessor
@Contract @ConstrainedTo(SERVER) public interface ModelProcessor
Contract for a model processors that processesresource modelsduring application initialization andresourcereturned by sub resource locators. Even thoughmodel processorscan completely change the resource model, the standard use case it to enhance the current resource model by additional methods and resources (like for example adding OPTIONS http methods for every URI endpoint). More model processors can be registered. These providers will be execute in the chain so that each model processor will be executed with resource model processed by the previous model processor. The first model processor in the chain will be invoked with the initial resource model from which the application was initiated. Model processors implementations can definebinding priorityto define the order in which they are executed (processors with a lower priority is invoked before processor with a higher priority). The highest possible priority (Integer.MAX_VALUE) is used for model processor which enhance resource models by the default OPTIONS method defined by JAX-RS specification and therefore this priority should not be used. Note that if model processor adds a resources that are intended to be supportive resources likeOPTIONSmethod providing information about the resource, it should properly define theextendedflag of such a new method. SeeExtendedResourcefor more information.- Author:
- Miroslav Fuksa
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResourceModelprocessResourceModel(ResourceModel resourceModel, jakarta.ws.rs.core.Configuration configuration)ProcessresourceModeland return the processed model.ResourceModelprocessSubResource(ResourceModel subResourceModel, jakarta.ws.rs.core.Configuration configuration)ProcesssubResourceModelwhich was returned a sub resource locator.
-
-
-
Method Detail
-
processResourceModel
ResourceModel processResourceModel(ResourceModel resourceModel, jakarta.ws.rs.core.Configuration configuration)
ProcessresourceModeland return the processed model. Returning inputresourceModelwill cause no effect on the final resource model.- Parameters:
resourceModel- Input resource model to be processed.configuration- Runtime configuration.- Returns:
- Processed resource model containing root resources. Non root resources will be ignored.
-
processSubResource
ResourceModel processSubResource(ResourceModel subResourceModel, jakarta.ws.rs.core.Configuration configuration)
ProcesssubResourceModelwhich was returned a sub resource locator. ThesubResourceModelcontains only oneresourcerepresenting model that should be processed by further matching. The method must return also exactly one resource in the model. Returning inputsubResourceModelinstance will cause no effect on the final sub resource model.- Parameters:
subResourceModel-Sub resourcewhich is based on sub resource returned from sub resource locator.configuration- Runtime configuration.- Returns:
- Processed resource model with one
resourcewhich should be used for handling sub resource.
-
-