public interface Token extends Expandable
All tokens can be represented as a text expression which cannot be
null
.
Two tokens having the same expression are considered equal.
Modifier and Type | Method and Description |
---|---|
String |
expression()
The expression corresponding to this token.
|
boolean |
isResolvable()
Indicates whether this token can be resolved.
|
boolean |
resolve(String expanded,
Map<Variable,Object> values)
Resolves the specified expanded URI part for this token.
|
expand
String expression()
boolean isResolvable()
A resolvable token contains variables which can be resolved.
true
if variables can be resolved from the specified pattern;
false
otherwise.boolean resolve(String expanded, Map<Variable,Object> values)
The resolution process requires all variables referenced in the token to be mapped to the value that is present in the expanded URI data.
expanded
- The part of the URI that correspond to an expanded version of the token.values
- The variables mapped to their values as a result of resolution.true
this operation was successful; false
otherwise.Copyright © 2016 Allette Systems. All rights reserved.