Class JerseyEnvironment


  • public class JerseyEnvironment
    extends Object
    • Method Detail

      • disable

        public void disable()
      • replace

        public void replace​(Function<org.glassfish.jersey.server.ResourceConfig,​jakarta.servlet.Servlet> replace)
      • register

        public void register​(Object component)
        Adds the given object as a Jersey singleton component.
        Parameters:
        component - a Jersey singleton component
      • register

        public void register​(Class<?> componentClass)
        Adds the given class as a Jersey component.

        N.B.: This class must either have a no-args constructor or use Jersey's built-in dependency injection.

        Parameters:
        componentClass - a Jersey component class
      • packages

        public void packages​(String... packages)
        Adds array of package names which will be used to scan for components. Packages will be scanned recursively, including all nested packages.
        Parameters:
        packages - array of package names
      • enable

        public void enable​(String featureName)
        Enables the Jersey feature with the given name.
        Parameters:
        featureName - the name of the feature to be enabled
        See Also:
        ResourceConfig
      • disable

        public void disable​(String featureName)
        Disables the Jersey feature with the given name.
        Parameters:
        featureName - the name of the feature to be disabled
        See Also:
        ResourceConfig
      • property

        public void property​(String name,
                             @Nullable Object value)
        Sets the given Jersey property.
        Parameters:
        name - the name of the Jersey property
        value - the value of the Jersey property
        See Also:
        ResourceConfig
      • getProperty

        public <T> @Nullable T getProperty​(String name)
        Gets the given Jersey property.
        Parameters:
        name - the name of the Jersey property
        See Also:
        ResourceConfig
      • getUrlPattern

        public String getUrlPattern()
      • setUrlPattern

        public void setUrlPattern​(String urlPattern)