public interface VarExploder
A VarExploder is invoked when an explode modifier "*" is encountered within
a variable name within a URI expression expression and the replacement value is a complex
type, such a some type of POJO or other data type. For most use cases, the DefaultVarExploder will be
sufficient. Please refer to the DefaultVarExploder JavaDoc
for more details on how it works.
Should the DefaultVarExploder not be suitable for your needs, custom VarExploder
implementations can be added by rolling your own implementation. A custom VarExploder
implementation can be registered in one of two ways. By wrapping your object in your VarExploder:
UriTemplate.fromTemplate("/mapper{?address*}").set("address", new MyCustomVarExploder(address)).expand();
Note: VarExploder implementations are ONLY invoked when the
explode modifier "*" is declared in the URI Template expression. If the variable declaration does not
specify the explode modifier, a VariableExpansionException will be raised.
Please see the unit test on example usage of a custom VarExploder.
| 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. |
Map<String,Object> getNameValuePairs()
Map of
name/value pairs.Collection<Object> getValues()
Collection of
object values.Copyright © April 30, 2012-2012 Ryan J. McDonough. All Rights Reserved.