Package net.obvj.confectory.mapper
Class PropertiesMapper
- java.lang.Object
-
- net.obvj.confectory.mapper.PropertiesMapper
-
- All Implemented Interfaces:
Mapper<Properties>
public class PropertiesMapper extends Object implements Mapper<Properties>
A specializedMapperthat loads the contents of aSource(e.g.: file, URL) asProperties(a table of key-value pairs).- Since:
- 0.1.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Constructor Summary
Constructors Constructor Description PropertiesMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Propertiesapply(InputStream inputStream)Applies thisMapperinto the given input.ConfigurationHelper<Properties>configurationHelper(Properties properties)Creates a newConfigurationHelperinstance recommended by thisMapper.
-
-
-
Method Detail
-
apply
public Properties apply(InputStream inputStream) throws IOException
Description copied from interface:MapperApplies thisMapperinto the given input.Note: The input stream must be closed by the caller after the mapping operation.
- Specified by:
applyin interfaceMapper<Properties>- Parameters:
inputStream- the input stream to be mapped- Returns:
- the mapped object
- Throws:
IOException- if a low-level I/O problem (such and unexpected end-of-input, or network error) occurs
-
configurationHelper
public ConfigurationHelper<Properties> configurationHelper(Properties properties)
Description copied from interface:MapperCreates a newConfigurationHelperinstance recommended by thisMapper.- Specified by:
configurationHelperin interfaceMapper<Properties>- Parameters:
properties- the configuration object to be used by the helper- Returns:
- a new
ConfigurationHelperinstance
-
-