Class UriTemplate

  • All Implemented Interfaces:

    public class UriTemplate
    extends Object
    implements Serializable

    This is the primary class for creating and manipulating URI templates. This project implements RFC6570 URI Templates and produces output that is compliant with the spec. The template processor supports levels 1 through 4. In addition to supporting Map and List values as composite types, the library also supports the use of Java objects as well. Please see the VarExploder and DefaultVarExploder for more info.

    Basic Usage:

    There are many ways to use this library. The simplest way is to create a template from a URI template string:

     UriTemplate template = UriTemplate.fromTemplate("{?q,lang}");

    Replacement values are added by calling the set(String, Object) method on the template:

     String uri = template.expand();

    The expand() method will replace the variable names with the supplied values and return the following URI:;lang=en
    $Revision: 1.1 $
    Ryan J. McDonough
    See Also:
    Serialized Form