Package io.micronaut.web.router.naming
Class ConfigurableUriNamingStrategy
java.lang.Object
io.micronaut.web.router.naming.HyphenatedUriNamingStrategy
io.micronaut.web.router.naming.ConfigurableUriNamingStrategy
- All Implemented Interfaces:
RouteBuilder.UriNamingStrategy
@Primary
@Singleton
@Replaces(HyphenatedUriNamingStrategy.class)
@Requires(property="micronaut.server.context-path")
public class ConfigurableUriNamingStrategy
extends HyphenatedUriNamingStrategy
The configurable
RouteBuilder.UriNamingStrategy
if property "micronaut.server.context-path" has been set.- Since:
- 1.2.0
-
Constructor Summary
ConstructorsConstructorDescriptionConfigurableUriNamingStrategy(String contextPath) Constructs a new uri naming strategy for the given property. -
Method Summary
Modifier and TypeMethodDescription@NonNull StringresolveUri(io.micronaut.inject.BeanDefinition<?> beanDefinition) Resolve the URI to use for the given type.resolveUri(Class type) Resolve the URI to use for the given type.@NonNull StringresolveUri(Class type, io.micronaut.core.naming.conventions.PropertyConvention id) Resolve the URI to use for the given type and route id.@NonNull StringresolveUri(String property) Resolve the URI to use for the given type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.web.router.RouteBuilder.UriNamingStrategy
normalizeUri
-
Constructor Details
-
ConfigurableUriNamingStrategy
Constructs a new uri naming strategy for the given property.- Parameters:
contextPath- the "micronaut.server.context-path" property value
-
-
Method Details
-
resolveUri
Description copied from interface:RouteBuilder.UriNamingStrategyResolve the URI to use for the given type.- Specified by:
resolveUriin interfaceRouteBuilder.UriNamingStrategy- Overrides:
resolveUriin classHyphenatedUriNamingStrategy- Parameters:
type- The type- Returns:
- The URI to use
-
resolveUri
Description copied from interface:RouteBuilder.UriNamingStrategyResolve the URI to use for the given type.- Specified by:
resolveUriin interfaceRouteBuilder.UriNamingStrategy- Overrides:
resolveUriin classHyphenatedUriNamingStrategy- Parameters:
beanDefinition- The type- Returns:
- The URI to use
-
resolveUri
Description copied from interface:RouteBuilder.UriNamingStrategyResolve the URI to use for the given type.- Specified by:
resolveUriin interfaceRouteBuilder.UriNamingStrategy- Overrides:
resolveUriin classHyphenatedUriNamingStrategy- Parameters:
property- The property- Returns:
- The URI to use
-
resolveUri
@NonNull public @NonNull String resolveUri(Class type, io.micronaut.core.naming.conventions.PropertyConvention id) Description copied from interface:RouteBuilder.UriNamingStrategyResolve the URI to use for the given type and route id.- Parameters:
type- The typeid- the route id- Returns:
- The URI to use
-