Package io.vertx.ext.web.impl
Class RouteImplHelper
- java.lang.Object
-
- io.vertx.ext.web.impl.RouteImplHelper
-
public class RouteImplHelper extends Object
A helper to access the results of the Vert.x route parser, for use in Irked support for dynamic runtime parameter configuration for controller methods, to circumvent Vert.x limits on access to the immutable RouteState. The parser results frankly should be accessible to the application for various reasons, but instead they are "secured" as "package private", which does nothing to prevent access and only serves to hinder useful implementations. Furthermore, theRouteStateclass is immutable and public access cannot even be abused for unsupported operations, so there really isn't any need to actively prevent access to it. This class is used by the Irked configuration stage (before the HTTP server is started, and before the realRouteObjects are created) to parse the route annotations on Controller methods, in a compatible way to the Vert.x-webRouter. Because of the intentional limitations put on the Vert.x-webRoutepublic API, this implementation relies on specifics of the Vert.x-web internal implementation, i.e. theRouteImplclass, but it also requires "package private" access to theRouterImpl#state()method. All access is read-only to an immutable value using the class API. Generally, we just need the aRouteStateinstance that contains the parsed results, but unfortunately not only doesRouteStatenot have a public constructor - most of the parsing code whose results are presented byRouteStateis actually inRouteImpl.- Author:
- odeda
-
-
Constructor Summary
Constructors Constructor Description RouteImplHelper(Router router, String path)Parse the specified route path for the specified Irked router, by creating a standaloneRouteImpl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vertx.ext.web.impl.RouteStategetState()Expose the parsedRouteStateresult.Set<String>listParameters()Retrieve the list of named path parameters that are specified by the submitted path
-