Package com.blackrook.small.struct
Class URITrie<V>
java.lang.Object
com.blackrook.small.struct.URITrie<V>
- Type Parameters:
V
- the value type at a resolved node.
A trie that organizes mapping URI patterns to values.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An exception thrown when a bad URI parse happens.static class
Result class after a URITrie search. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a path to the trie.void
printTo
(PrintStream out) Attempts to resolve a value for a given URI.
-
Field Details
-
DEFAULT_TOKEN
Token content for "default" path.- See Also:
-
-
Constructor Details
-
URITrie
public URITrie()Creates a new blank URI Trie.
-
-
Method Details
-
add
Adds a path to the trie.- Parameters:
uri
- the request URI path.value
- the mapped value.- Throws:
URITrie.ParseException
- if a path parsing error occurs.PatternSyntaxException
- if a regex expression is invalid in one of the paths.
-
resolve
Attempts to resolve a value for a given URI.- Parameters:
uri
- the input URI.- Returns:
- a result object detailing the search.
-
printTo
-