Class PathManager

java.lang.Object
com.aquima.web.util.PathManager

@Component public class PathManager extends Object
The path manager is a component that can be used to register and later obtain instances of specific PathHelpers. Path helpers are indexed by their actual concrete type.

This manager automatically detects PathHelper beans in the root application context. Other non-bean path helpers can be manually registered using the register(PathHelper) method.

Since:
10.0
Author:
Petru Galanton
  • Constructor Details Link icon

    • PathManager Link icon

      public PathManager()
  • Method Details Link icon

    • register Link icon

      public <T extends PathHelper> void register(T pathHelper)
      Register a path helper with this manager. The path helper can later be obtained from this manager using the get(Class) method. If a path helper of the same concrete type is already registered, the newly registered helper will replace the old helper.
      Type Parameters:
      T - the type of the pathHelper, extends PathHelper
      Parameters:
      pathHelper - the path helper to register (not null)
    • get Link icon

      public <T extends PathHelper> T get(Class<T> helperClass)
      Returns the previously registered path helper of the specified concrete type. If no path helper of the requested type is registered an exception is thrown.
      Type Parameters:
      T - the type of the pathHelper, extends PathHelper
      Parameters:
      helperClass - the concrete type of the requested helper
      Returns:
      the helper of the specified concrete type
      Throws:
      IllegalArgumentException - if no path helper of the specified type is registered.
    • registerRootContextHelpers Link icon

      @Autowired public void registerRootContextHelpers(List<PathHelper> helpers)