public class URIResolver extends Object
// Create a resolver instance
URIResolver resolver = new URIResolver("http://www.acme.com/test/home");
// Find the matching pattern amongst a list of precompiled URI patterns
URIPattern pattern = resolver.find(patterns);
// Resolve the URI for the specified pattern, the result holds all the matching info
URIResolveResult result = resolver.resolve(p);
| Modifier and Type | Class and Description |
|---|---|
static class |
URIResolver.MatchRule
Defines the priority rule for matching patterns.
|
| Constructor and Description |
|---|
URIResolver(String uri) |
URIResolver(String uri,
boolean encode)
Creates a new resolver for the specified URI.
|
| Modifier and Type | Method and Description |
|---|---|
URIPattern |
find(Set<URIPattern> patterns)
Returns the first URI pattern in the list which matches the underlying URI.
|
URIPattern |
find(Set<URIPattern> patterns,
URIResolver.MatchRule rule)
Returns the first URI pattern in the list which matches the underlying URI.
|
Collection<URIPattern> |
findAll(Set<URIPattern> patterns)
Returns all the URI patterns in the list which match the underlying URI.
|
URIResolveResult |
resolve(URIPattern pattern)
Resolves the given URI pattern.
|
URIResolveResult |
resolve(URIPattern pattern,
VariableBinder binder)
Resolves the given URI pattern using the specified variable binder.
|
String |
uri()
Returns the URI handled by this resolver.
|
public URIResolver(String uri, boolean encode)
uri - The URI to resolve.public URIResolver(String uri)
public String uri()
public URIPattern find(Set<URIPattern> patterns)
patterns - The URI patterns available.null.public URIPattern find(Set<URIPattern> patterns, URIResolver.MatchRule rule)
patterns - The URI patterns available.rule - The rule used to select the matching patterns in case of multiple matches.null.public Collection<URIPattern> findAll(Set<URIPattern> patterns)
patterns - The URI patterns available.public URIResolveResult resolve(URIPattern pattern)
pattern - The pattern to resolve.public URIResolveResult resolve(URIPattern pattern, VariableBinder binder)
pattern - The pattern to resolve.binder - The variable binder.Copyright © 2014. All rights reserved.