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:
/mapper{?address*}
And this Java object for an address:
Address address = new Address();
address.setState("CA");
address.setCity("Newport Beach");
String result = UriTemplate.fromTemplate("/mapper{?address*}").set("address", address).expand();
The expanded URI will be:
/mapper?city=Newport%20Beach&state=CA
The DefaultVarExploder breaks down the object properties as follows:
UriTransient will NOT included in the listVarName annotation on the field or getter method and specifying a name.VarName,
UriTransient,
VarExploder| Constructor and Description |
|---|
DefaultVarExploder(Object source) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
getNameValuePairs()
Returns the properties of the source object a
Map of
name/value pairs. |
Collection<Object> |
getValues()
Returns the properties of the source object a
Collection of
object values. |
void |
setSource(Object source) |
public DefaultVarExploder(Object source)
source - the Object to explodepublic Map<String,Object> getNameValuePairs()
VarExploderMap of
name/value pairs.getNameValuePairs in interface VarExploderpublic void setSource(Object source)
public Collection<Object> getValues()
VarExploderCollection of
object values.getValues in interface VarExploderCopyright © April 30, 2012-2012 Ryan J. McDonough. All Rights Reserved.