@Contract @ConstrainedTo(value=SERVER) public interface ModelProcessor
resource modelsduring application initialization and
resourcereturned by sub resource locators. Even though
model 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 define
binding 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 like
OPTIONSmethod providing information about the resource, it should properly define the
extendedflag of such a new method. See
ExtendedResourcefor more information.
|Modifier and Type||Method and Description|
ResourceModel processResourceModel(ResourceModel resourceModel, javax.ws.rs.core.Configuration configuration)
resourceModeland return the processed model. Returning input
resourceModelwill cause no effect on the final resource model.
resourceModel- Input resource model to be processed.
configuration- Runtime configuration.
ResourceModel processSubResource(ResourceModel subResourceModel, javax.ws.rs.core.Configuration configuration)
subResourceModelwhich was returned a sub resource locator. The
subResourceModelcontains only one
resourcerepresenting model that should be processed by further matching. The method must return also exactly one resource in the model. Returning input
subResourceModelinstance will cause no effect on the final sub resource model.
Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.