Maps a URL path pattern to a logical controller registered by an app, with the list of methods that can be invoked against it based on the HTTP method and any required parameter. Instances are produced by ControllerMappingBuilder.build and consumed when routing a request to the matching ControllerResource. Serialised as a controller element when an app's routing is written out.
Group: App Definitions
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| breadCrumbs | Object | The breadcrumbs configured for this controller, either a prebuilt map or the name of a JS function that computes them at request time. May be null. |
| childMappings | List<ControllerMapping> | The child controller mappings nested under this one. Never null, may be empty. |
| collection | boolean | Whether this controller behaves as a collection, either because it has child mappings or mounts a content repository. |
| contentRepoName | String | The name of the content repository mounted at this controller's path, when it was registered with mountRepository. May be null. |
| defaultView | View | The view used to render this controller's response when a matched method does not specify its own view. May be null. |
| enabled | boolean | Whether this controller mapping is active. A disabled mapping is not matched to incoming requests. |
| methods | List<ControllerMethod> | The controller methods registered against this mapping's path, each associated with an HTTP method and an optional required parameter. Never null. |
| modifiedDate | Object | The modified date configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null. |
| namedGroups | List<String> | Scans this mapping's path for named regular expression groups, for example a group named id, and returns their names in the order they appear. |
| path | String | The path or regular expression this controller is mapped to, for example /services/uploads/* or a matching pattern for an incoming email address. |
| pathRegex | Pattern | The compiled regular expression for this mapping's path, compiling and caching it on first use. An empty pattern is used when the path is null. |
| pathResolvers | Map<String,Object> | Resolvers used to compute path segment values, keyed by the named regular expression group they resolve. Never null, may be empty. |
| public | boolean | Whether this controller can be accessed without authentication. |
| regex | Pattern | The compiled regular expression for this mapping's path, if getPathRegex has already been called. May be null if the path has not yet been compiled. |
| requiredPostPriviledge | Priviledge | The privilege a user must hold to POST to this controller. May be null if no privilege is required. |
| rolePrivs | Map<String,List<Priviledge>> | The privileges required to access this controller, keyed by role name. May be null if no role-based privileges were configured. |
| segment | boolean | Whether this mapping represents a single dynamic path segment, resolved via a path resolver, rather than a fixed or regular expression path. |
| seoContent | Object | The SEO content configured for this controller, typically the name of a JS function invoked to populate it at request time. May be null. |
| title | Object | The title configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null. |
| types | Set<String> | The resource type tags applied to this controller, for example html, used to match roles and other type-based rules against it. |
| uniqueId | Object | The unique id configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null. |
Methods
getRolePrivs() · isEnabled() · isPublic() · getMethods() · getPath() · getTitle() · getBreadCrumbs() · getUniqueId() · getModifiedDate() · getSeoContent() · getPathResolvers() · getChildMappings() · getRegex() · getPathRegex() · getDefaultView() · getNamedGroups() · getControllerMethod(Request req) · getRequiredPostPriviledge() · getTypes() · isCollection() · getContentRepoName() · isSegment()
getRolePrivs()
Returns: Map<String,List<Priviledge>>
The privileges required to access this controller, keyed by role name. May be null if no role-based privileges were configured.
isEnabled()
Returns: boolean
Whether this controller mapping is active. A disabled mapping is not matched to incoming requests.
isPublic()
Returns: boolean
Whether this controller can be accessed without authentication.
getMethods()
Returns: List<ControllerMethod>
The controller methods registered against this mapping's path, each associated with an HTTP method and an optional required parameter. Never null.
getPath()
Returns: String
The path or regular expression this controller is mapped to, for example /services/uploads/* or a matching pattern for an incoming email address.
getTitle()
Returns: Object
The title configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null.
getBreadCrumbs()
Returns: Object
The breadcrumbs configured for this controller, either a prebuilt map or the name of a JS function that computes them at request time. May be null.
getUniqueId()
Returns: Object
The unique id configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null.
getModifiedDate()
Returns: Object
The modified date configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null.
getSeoContent()
Returns: Object
The SEO content configured for this controller, typically the name of a JS function invoked to populate it at request time. May be null.
getPathResolvers()
Returns: Map<String,Object>
Resolvers used to compute path segment values, keyed by the named regular expression group they resolve. Never null, may be empty.
getChildMappings()
Returns: List<ControllerMapping>
The child controller mappings nested under this one. Never null, may be empty.
getRegex()
Returns: Pattern
The compiled regular expression for this mapping's path, if getPathRegex has already been called. May be null if the path has not yet been compiled.
getPathRegex()
Returns: Pattern
The compiled regular expression for this mapping's path, compiling and caching it on first use. An empty pattern is used when the path is null.
getDefaultView()
Returns: View
The view used to render this controller's response when a matched method does not specify its own view. May be null.
getNamedGroups()
Returns: List<String>
Scans this mapping's path for named regular expression groups, for example a group named id, and returns their names in the order they appear.
getControllerMethod(Request req)
Returns: ControllerMethod
Finds the first controller method whose HTTP method and required parameter match the given request.
| Parameter | Description |
|---|---|
req | the request to match against this mapping's methods |
getRequiredPostPriviledge()
Returns: Priviledge
The privilege a user must hold to POST to this controller. May be null if no privilege is required.
getTypes()
Returns: Set<String>
The resource type tags applied to this controller, for example html, used to match roles and other type-based rules against it.
isCollection()
Returns: boolean
Whether this controller behaves as a collection, either because it has child mappings or mounts a content repository.
getContentRepoName()
Returns: String
The name of the content repository mounted at this controller's path, when it was registered with mountRepository. May be null.
isSegment()
Returns: boolean
Whether this mapping represents a single dynamic path segment, resolved via a path resolver, rather than a fixed or regular expression path.