Class DeploymentContext.Builder

  • Direct Known Subclasses:
    ServletDeploymentContext.Builder
    Enclosing class:
    DeploymentContext

    public static class DeploymentContext.Builder
    extends Object
    Deployment context builder for building a basic application deployment context for the JAX-RS / Jersey application defined by the associated Application class or instance.

    If properties of the builder are not modified, default values will be utilized:

    • Default value for the context path is an empty string

    After build() has been invoked, the state of the builder will be reset to default values and another context for the associated JAX-RS / Jersey application can be prepared and built.

    • Constructor Detail

      • Builder

        protected Builder()
        Create new deployment context builder instance not explicitly bound to the JAX-RS / Jersey application class.

        The constructor is provided to support different subclass initialization scenarios.

      • Builder

        protected Builder​(Application app)
        Create new deployment context builder instance and bind it to the JAX-RS / Jersey application instance.
        Parameters:
        app - JAX-RS / Jersey application instance.
      • Builder

        protected Builder​(Class<? extends Application> appClass)
        Create new deployment context builder instance and bind it to the JAX-RS / Jersey application class.
        Parameters:
        appClass - JAX-RS / Jersey application class.
    • Method Detail

      • contextPath

        public DeploymentContext.Builder contextPath​(String contextPath)
        Set the application deployment context path.
        Parameters:
        contextPath - application context path.
        Returns:
        this application deployment context builder.
        Throws:
        NullPointerException - if contextPath is null.
      • build

        public DeploymentContext build()
        Build a new application deployment context configured by the current state of this application deployment context builder.
        Returns:
        this application deployment context builder.
      • reset

        protected void reset()
        Reset the application deployment context builder values to defaults. Note that the builder still remains bound to the same JAX-RS / Jersey application instance.