Class URITrie<V>

java.lang.Object
com.blackrook.small.struct.URITrie<V>
Type Parameters:
V - the value type at a resolved node.

public class URITrie<V> extends Object
A trie that organizes mapping URI patterns to values.
Author:
Matthew Tropiano
  • Field Details

  • Constructor Details

    • URITrie

      public URITrie()
      Creates a new blank URI Trie.
  • Method Details

    • add

      public void add(String uri, V value)
      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

      public URITrie.Result<V> resolve(String uri)
      Attempts to resolve a value for a given URI.
      Parameters:
      uri - the input URI.
      Returns:
      a result object detailing the search.
    • printTo

      public void printTo(PrintStream out)