Package net.obvj.confectory.mapper
Class StringMapper
- java.lang.Object
-
- net.obvj.confectory.mapper.AbstractBeanMapper<String>
-
- net.obvj.confectory.mapper.StringMapper
-
public class StringMapper extends AbstractBeanMapper<String> implements Mapper<String>
A specializedMapperthat loads the contents of aSource(e.g.: file, URL) as aStringusing the JVM defaultCharset.This is typically intended for testing/troubleshooting or manual handling purposes.
- Since:
- 0.1.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Constructor Summary
Constructors Constructor Description StringMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringapply(InputStream inputStream)Applies thisMapperinto the given input.-
Methods inherited from class net.obvj.confectory.mapper.AbstractBeanMapper
configurationHelper
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.obvj.confectory.mapper.Mapper
configurationHelper
-
-
-
-
Method Detail
-
apply
public String 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<String>- 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
-
-