Class DefaultVarExploder

  • All Implemented Interfaces:

    public class DefaultVarExploder
    extends Object
    implements VarExploder

    The DefaultVarExploder is a VarExploder implementation that takes in a Java object and extracts the properties for use in a URI Template. Given the following URI expression:


    And this Java object for an address:

     Address address = new Address();
     address.setCity("Newport Beach");
     String result = UriTemplate.fromTemplate("/mapper{?address*}").set("address", address).expand();

    The expanded URI will be:


    The DefaultVarExploder breaks down the object properties as follows:

    • All properties that contain a non-null return value will be included
    • Getters or fields annotated with UriTransient will NOT included in the list
    • By default, the property name is used as the label in the URI. This can be overridden by placing the VarName annotation on the field or getter method and specifying a name.
    • Field level annotation take priority of getter annotations
    $Revision: 1.1 $
    Ryan J. McDonough
    See Also:
    VarName, UriTransient, VarExploder