public class TokenOperatorDX extends Object implements Matchable
instruction = "{" [ operator ] variable-list "}"
operator = "/" / "+" / ";" / "?" / op-reserve
variable-list = varspec *( "," varspec )
varspec = [ var-type ] varname [ ":" prefix-len ] [ "=" default ]
var-type = "@" / "%" / type-reserve
varname = ALPHA *( ALPHA | DIGIT | "_" )
prefix-len = 1*DIGIT
default = *( unreserved / reserved )
op-reserve = <anything else that isn't ALPHA or operator>
type-reserve = <anything else that isn't ALPHA, ",", or operator>
| Modifier and Type | Class and Description |
|---|---|
static class |
TokenOperatorDX.Operator
The list of operators currently supported.
|
| Constructor and Description |
|---|
TokenOperatorDX(TokenOperatorDX.Operator op,
List<Variable> vars)
Creates a new operator token.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Two tokens are equals if and only if their string expression is equal.
|
String |
expression()
The expression corresponding to this token.
|
int |
hashCode() |
boolean |
isResolvable()
Indicates whether this token can be resolved.
|
boolean |
match(String part)
Indicates whether this token matches the specified part of a URL.
|
TokenOperatorDX.Operator |
operator()
Returns the operator part of this token.
|
static TokenOperatorDX |
parse(String exp)
Parses the specified string and returns the corresponding token.
|
Pattern |
pattern()
Returns a regular expression pattern corresponding to this object.
|
boolean |
resolve(String expanded,
Map<Variable,Object> values)
Resolves the specified expanded URI part for this token.
|
protected static String |
strip(String exp)
Removes the curly brackets from the specified expression.
|
static TokenOperatorDX.Operator |
toOperator(char c)
Returns the operator if it is defined in this class.
|
String |
toString() |
protected static List<Variable> |
toVariables(String exp)
Returns the variables for a given expression containing a list of variables.
|
public TokenOperatorDX(TokenOperatorDX.Operator op, List<Variable> vars) throws NullPointerException
op - The operator to use.vars - The variables for this operator.NullPointerException - If any of the argument is null.public TokenOperatorDX.Operator operator()
public boolean isResolvable()
A resolvable token contains variables which can be resolved.
By default a token is resolvable if it can be matched.isResolvable in interface Tokentrue if variables can be resolved from the specified pattern; false otherwise.public 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.
public boolean match(String part)
public Pattern pattern()
public static TokenOperatorDX.Operator toOperator(char c)
c - The character representation of the operator.public static TokenOperatorDX parse(String exp) throws URITemplateSyntaxException
exp - The expression to get.URITemplateSyntaxException - If the string cannot be parsed as a validpublic String expression()
expression in interface Tokenpublic boolean equals(Object o)
protected static final String strip(String exp)
exp - The expression to 'strip'.protected static final List<Variable> toVariables(String exp) throws URITemplateSyntaxException
exp - An expression containing a comma separated list of variables.URITemplateSyntaxException - If thrown by the Variable get method.Copyright © 2025. All rights reserved.