AddressTemplate
Template for a DMR address which might contain multiple variable parts.
An address template can be defined using the following BNF:
<address template> ::= "/" | <segment> <segment> ::= <tuple> | <segment>"/"<tuple> <tuple> ::= <variable> | <key>"="<value> <variable> ::= "{"<alpha>"}" <key> ::= <alpha> <value> ::= <variable> | <alpha> | "*" <alpha> ::= <upper> | <lower> <upper> ::= "A" | "B" | … | "Z" <lower> ::= "a" | "b" | … | "z"
Following variables are supported:
{domain.controller}
{selected.profile}
{selected.group}
{selected.server-config}
{selected.server}
To get a fully qualified address from an address template use the method resolve()
. For standalone mode
the variables will resolve to an empty string. The values of the variables are managed by the {@link
StatementContext}.
Example:
AddressTemplate a2 = AddressTemplate.of("{selected.profile}");
AddressTemplate a3 = AddressTemplate.of("{selected.profile}/subsystem=mail");
AddressTemplate a4 = AddressTemplate.of("{selected.profile}/subsystem=mail/mail-session=*");
Static Member Summary
Static Public Members | ||
public static get |
The root template |
Static Method Summary
Static Public Methods | ||
public static |
of(template: *) Creates a new address template from an encoded string template. |
Member Summary
Public Members | ||
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
Method Summary
Public Methods | ||
public |
append(address: string | AddressTemplate): AddressTemplate Append an address to this addrress template and return a new one. |
|
public |
resolve(context: StatementContext, wildcards: ...string): ResourceAddress Resolve this address template against the specified statement context. |
|
public |
|
Static Public Members
Static Public Methods
public static of(template: *) source
Creates a new address template from an encoded string template.
Params:
Name | Type | Attribute | Description |
template | * |
Public Members
public get parent: AddressTemplate source
Public Methods
public append(address: string | AddressTemplate): AddressTemplate source
Append an address to this addrress template and return a new one.
Params:
Name | Type | Attribute | Description |
address | string | AddressTemplate | The address to append. |
public resolve(context: StatementContext, wildcards: ...string): ResourceAddress source
Resolve this address template against the specified statement context.
Params:
Name | Type | Attribute | Description |
context | StatementContext | the statement context |
|
wildcards | ...string | An optional list of wildcards which are used to resolve any wildcards in this address template from left to right |
Return:
ResourceAddress | a fully qualified resource address which might be empty, but which does not contain any tokens |