Search in sources :

Example 1 with ModelProcessor

use of org.glassfish.jersey.server.model.ModelProcessor in project jersey by jersey.

the class RuntimeLocatorModelBuilder method enhance.

private ResourceModel enhance(ResourceModel subResourceModel) {
    final Iterable<RankedProvider<ModelProcessor>> allRankedProviders = Providers.getAllRankedProviders(injectionManager, ModelProcessor.class);
    final Iterable<ModelProcessor> modelProcessors = Providers.sortRankedProviders(new RankedComparator<ModelProcessor>(), allRankedProviders);
    for (final ModelProcessor modelProcessor : modelProcessors) {
        subResourceModel = modelProcessor.processSubResource(subResourceModel, config);
        validateSubResource(subResourceModel);
    }
    return subResourceModel;
}
Also used : RankedProvider(org.glassfish.jersey.model.internal.RankedProvider) ModelProcessor(org.glassfish.jersey.server.model.ModelProcessor)

Example 2 with ModelProcessor

use of org.glassfish.jersey.server.model.ModelProcessor in project jersey by jersey.

the class ApplicationHandler method processResourceModel.

private ResourceModel processResourceModel(ResourceModel resourceModel) {
    final Iterable<RankedProvider<ModelProcessor>> allRankedProviders = Providers.getAllRankedProviders(injectionManager, ModelProcessor.class);
    final Iterable<ModelProcessor> modelProcessors = Providers.sortRankedProviders(new RankedComparator<ModelProcessor>(), allRankedProviders);
    for (final ModelProcessor modelProcessor : modelProcessors) {
        resourceModel = modelProcessor.processResourceModel(resourceModel, getConfiguration());
    }
    return resourceModel;
}
Also used : RankedProvider(org.glassfish.jersey.model.internal.RankedProvider) ModelProcessor(org.glassfish.jersey.server.model.ModelProcessor)

Aggregations

RankedProvider (org.glassfish.jersey.model.internal.RankedProvider)2 ModelProcessor (org.glassfish.jersey.server.model.ModelProcessor)2