Class RuntimeLocatorModelBuilder


  • final class RuntimeLocatorModelBuilder
    extends java.lang.Object
    Base for sub-resource locator runtime model builder.
    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
      • config

        private final javax.ws.rs.core.Configuration config
      • modelProcessors

        private final java.lang.Iterable<ModelProcessor> modelProcessors
      • createServiceFunction

        private final java.util.function.Function<java.lang.Class<?>,​?> createServiceFunction
      • disableValidation

        private final boolean disableValidation
      • ignoreValidationErrors

        private final boolean ignoreValidationErrors
      • enableJerseyResourceCaching

        private final boolean enableJerseyResourceCaching
    • Constructor Detail

      • RuntimeLocatorModelBuilder

        RuntimeLocatorModelBuilder​(javax.ws.rs.core.Configuration config,
                                   MessageBodyWorkers messageBodyWorkers,
                                   java.util.Collection<ValueParamProvider> valueSuppliers,
                                   JerseyResourceContext resourceContext,
                                   RuntimeModelBuilder runtimeModelBuilder,
                                   java.lang.Iterable<ModelProcessor> modelProcessors,
                                   java.util.function.Function<java.lang.Class<?>,​?> createServiceFunction)
        Create a new instance of the runtime model builder for sub-resource locators.
        Parameters:
        config - configuration of the application.
        messageBodyWorkers - message body workers registred in an application.
        valueSuppliers - all value registered value providers.
        resourceContext - resource context to bind sub-resource locator singleton instances.
        runtimeModelBuilder - runtime model builder to build routers for locator models.
        modelProcessors - all registered model processors.
        createServiceFunction - function that is able to create and initialize new service.
    • Method Detail

      • getRouter

        Router getRouter​(ResourceMethod resourceMethod)
        Obtain a sub-resource locator router for given resource method.
        Parameters:
        resourceMethod - resource method to obtain the router for.
        Returns:
        sub-resource locator router.
      • getRouting

        LocatorRouting getRouting​(java.lang.Class<?> locatorClass)
        Build (or obtain from cache) a resource model and router for given sub-resource locator class.
        Parameters:
        locatorClass - sub-resource locator class to built model and router for.
        Returns:
        [locator, router] pair with built model and router for sub-resource locator.
      • getRouting

        LocatorRouting getRouting​(Resource subresource)
        Build (or obtain from cache) a resource model and router for given sub-resource injectionManager resource.
        Parameters:
        subresource - sub-resource injectionManager resource to built model and router for.
        Returns:
        [injectionManager, router] pair with built model and router for sub-resource injectionManager.
      • isCached

        boolean isCached​(java.lang.Class<?> srlClass)
        Check if the model builder contains a cached [locator, router] pair for a given sub-resource locator class.
        Parameters:
        srlClass - sub-resource locator class.
        Returns:
        true if the [locator, router] pair for the sub-resource locator class is present in the cache, false otherwise.
      • createRouting

        private LocatorRouting createRouting​(java.lang.Class<?> locatorClass)
      • validateSubResource

        private void validateSubResource​(ResourceModel subResourceModel)