|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.module.apikit.uri.TokenLiteral
public class TokenLiteral
A URI token corresponding to the literal text part of the URI template.
Literal text remains identical during the expansion process (parameters are ignored).
Literal text tokens only match text that is equal.
The expression for a literal token does contain curly brackets.
| Constructor Summary | |
|---|---|
TokenLiteral(String text)
Creates a new literal text token. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
Two tokens are equals if and only if their string expression is equal. |
String |
expand(Parameters parameters)
Expands this object to produce a URI fragment as defined by the URI Template specifications. |
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. |
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. |
String |
toString()
|
protected static List<Variable> |
toVariables(String exp)
Returns the variables for a given expression containing a list of variables. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.mule.module.apikit.uri.Token |
|---|
expression, isResolvable |
| Constructor Detail |
|---|
public TokenLiteral(String text)
throws NullPointerException
text - The text corresponding to this URI token.
NullPointerException - If the specified text is null.| Method Detail |
|---|
public String expand(Parameters parameters)
expand in interface Expandableparameters - The list of parameters and their values for substitution.
public boolean match(String part)
match in interface Matchablepart - The part of URL to test for matching.
true if it matches; false otherwise.public Pattern pattern()
pattern in interface Matchable
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.
By definition, no variable in this token. This method does nothing and always returnstrue.
resolve in interface Tokenexpanded - 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.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 String expression()
expression in interface Tokenpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectprotected static final String strip(String 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 parse method.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||