This class contains various macros to generate URL mappings using a class' metadata.
Static methods
staticcreateHttpMappingArray (clExpr:Dynamic, urlMetaTag:Dynamic, ?httpMethodMetaTag:Dynamic, ?prefix:Dynamic):Dynamic
This will map a controller's methods to URLs using the given meta tag name. Use this macro inside a Module instance.
This macro scans a controller for method metadata in order to generate mappings. This macro shouldn't have any dependency regarding the object it's called from, but it is most often used from a Module instance.
To use this macro, annotate a controller's method like this: @URL("/")
Parameters:
clExpr | The controller's class (must be an implementation of the Controller interface) |
---|---|
urlMetaTag | The metadata tag that will be used to extract the URL regular expression from a controller method. The URL meta tag must have at least one parameter : the URL pattern. A second parameter may be used for regular expression options. |
httpMethodMetaTag | Optional, the metadata tag that will be used to specify the HTTP method on which the URL mapping will be valid |
prefix | Optional, defines a string to prefix all of the controller's URL. In order for this to work, the URL meta tag must have 3 parameters : the URL pattern, the regular expression's options and the string in your regular expression that will be replaced with the given prefix. |
Returns:
An array of expressions containing all the ERegURLMapping instances that maps the controllers to URLs.
staticmapHttpController (eThis:Dynamic, clExpr:Dynamic, urlMetaTag:Dynamic, ?httpMethodMetaTag:Dynamic, ?prefix:Dynamic):Dynamic
This will map a controller's methods to URLs using the given meta tag name. Use this macro inside an AbstractModule instance.
This macro scans a controller for method metadata in order to generate mappings. This macro depends on AbstractModule's addURLMapping method. Thus, it can only be used with AbstractModule or a Module implementation that supports the same addURLMapping method signature.
To use this macro, annotate a controller's method like this: @URL("/")
Parameters:
eThis | The module instance (must be a subclass of AbstractModule) |
---|---|
clExpr | The controller's class (must be an implementation of the Controller interface) |
urlMetaTag | The metadata tag that will be used to extract the URL regular expression from a controller method. The URL meta tag must have at least one parameter : the URL pattern. A second parameter may be used for regular expression options. |
httpMethodMetaTag | Optional, the metadata tag that will be used to specify the HTTP method on which the URL mapping will be valid |
prefix | Optional parameter that defines a string to prefix all of the controller's URL. In order for this to work, the URL meta tag must have 3 parameters : the URL pattern, the regular expression's options and the string in your regular expression that will be replaced with the given prefix. |
Returns:
The addURLMapping expressions that will map the controllers to URLs.