Interface VarExploder
-
- All Known Implementing Classes:
DefaultVarExploder
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, theDefaultVarExploder
will be sufficient. Please refer to theDefaultVarExploder
JavaDoc for more details on how it works.Should the
DefaultVarExploder
not be suitable for your needs, customVarExploder
implementations can be added by rolling your own implementation. A customVarExploder
implementation can be registered in one of two ways. By wrapping your object in yourVarExploder
: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, aVariableExpansionException
will be raised.Please see the unit test on example usage of a custom
VarExploder
.- Since:
- 1.0
- Version:
- $Revision: 1.1 $
- Author:
- Ryan J. McDonough
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,Object>
getNameValuePairs()
Returns the properties of the source object aMap
of name/value pairs.Collection<Object>
getValues()
Returns the properties of the source object aCollection
of object values.
-
-
-
Method Detail
-
getNameValuePairs
Map<String,Object> getNameValuePairs() throws VariableExpansionException
Returns the properties of the source object aMap
of name/value pairs.- Returns:
- the object properties as name/value pairs.
- Throws:
VariableExpansionException
-
getValues
Collection<Object> getValues() throws VariableExpansionException
Returns the properties of the source object aCollection
of object values.- Returns:
- Throws:
VariableExpansionException
-
-