Package jadex.extension.rs.invoke.mapper
Class IterableStringMapper
- java.lang.Object
- 
- jadex.extension.rs.invoke.mapper.IterableStringMapper
 
- 
- All Implemented Interfaces:
- IValueMapper
 
 public class IterableStringMapper extends java.lang.Object implements IValueMapper The iterable string mapper can be used to map an object that can be iterated over (e.g. collection, array, enumeration, ...) to a string with definable delimiter (e.g. ","). In addition a prefix and postfix can be given which are pre- and postpended to the string. A submapper can be used to handle more complex cases in a recursive way. For each element the submapper is invoked so that e.g. multidimensional arrays can be processed.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.StringdelimThe delimiter.protected java.lang.StringpostfixThe string postfix.protected java.lang.StringprefixThe string prefix,protected IValueMappersubmapperThe optional submapper.
 - 
Constructor SummaryConstructors Constructor Description IterableStringMapper()Create a new string mapper.IterableStringMapper(java.lang.String delim)Create a new string mapper.IterableStringMapper(java.lang.String delim, IValueMapper submapper)Create a new string mapper.IterableStringMapper(java.lang.String prefix, java.lang.String delim)Create a new string mapper.IterableStringMapper(java.lang.String prefix, java.lang.String delim, java.lang.String postfix)Create a new string mapper.IterableStringMapper(java.lang.String prefix, java.lang.String delim, java.lang.String postfix, IValueMapper submapper)Create a new string mapper.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectconvertValue(java.lang.Object value)Convert the given value.
 
- 
- 
- 
Field Detail- 
delimprotected java.lang.String delim The delimiter.
 - 
prefixprotected java.lang.String prefix The string prefix,
 - 
postfixprotected java.lang.String postfix The string postfix.
 - 
submapperprotected IValueMapper submapper The optional submapper.
 
- 
 - 
Constructor Detail- 
IterableStringMapperpublic IterableStringMapper() Create a new string mapper.
 - 
IterableStringMapperpublic IterableStringMapper(java.lang.String delim) Create a new string mapper.- Parameters:
- delim- The delimiter that is placed between elements.
 
 - 
IterableStringMapperpublic IterableStringMapper(java.lang.String delim, IValueMapper submapper)Create a new string mapper.- Parameters:
- delim- The delimiter that is placed between elements.
- submapper- The submapper that will be invoked for each element.
 
 - 
IterableStringMapperpublic IterableStringMapper(java.lang.String prefix, java.lang.String delim)Create a new string mapper.- Parameters:
- prefix- The prefix for the result string.
- delim- The delimiter that is placed between elements.
 
 - 
IterableStringMapperpublic IterableStringMapper(java.lang.String prefix, java.lang.String delim, java.lang.String postfix)Create a new string mapper.- Parameters:
- prefix- The prefix for the result string.
- delim- The delimiter that is placed between elements.
- postfix- The postfix for the result string.
 
 - 
IterableStringMapperpublic IterableStringMapper(java.lang.String prefix, java.lang.String delim, java.lang.String postfix, IValueMapper submapper)Create a new string mapper.- Parameters:
- prefix- The prefix for the result string.
- delim- The delimiter that is placed between elements.
- postfix- The postfix for the result string.
- submapper- The submapper that will be invoked for each element.
 
 
- 
 - 
Method Detail- 
convertValuepublic java.lang.Object convertValue(java.lang.Object value) throws java.lang.ExceptionConvert the given value.- Specified by:
- convertValuein interface- IValueMapper
- Parameters:
- value- The value to convert.
- Returns:
- The converted value.
- Throws:
- java.lang.Exception
 
 
- 
 
-