Package com.aquima.web.util
Class PathManager
java.lang.Object
com.aquima.web.util.PathManager
The path manager is a component that can be used to register and later obtain instances of specific
PathHelper
s. 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends PathHelper>
TReturns the previously registered path helper of the specified concrete type.<T extends PathHelper>
voidregister
(T pathHelper) Register a path helper with this manager.void
registerRootContextHelpers
(List<PathHelper> helpers)
-
Constructor Details
-
Method Details
-
register
Register a path helper with this manager. The path helper can later be obtained from this manager using theget(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, extendsPathHelper
- Parameters:
pathHelper
- the path helper to register (not null)
-
get
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, extendsPathHelper
- 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
-