Class StringMapper

  • All Implemented Interfaces:
    Mapper<String>

    public class StringMapper
    extends AbstractBeanMapper<String>
    implements Mapper<String>
    A specialized Mapper that loads the contents of a Source (e.g.: file, URL) as a String using the JVM default Charset.

    This is typically intended for testing/troubleshooting or manual handling purposes.

    Since:
    0.1.0
    Author:
    oswaldo.bapvic.jr (Oswaldo Junior)
    • Constructor Detail

      • StringMapper

        public StringMapper()
    • Method Detail

      • apply

        public String apply​(InputStream inputStream)
                     throws IOException
        Description copied from interface: Mapper
        Applies this Mapper into the given input.

        Note: The input stream must be closed by the caller after the mapping operation.

        Specified by:
        apply in interface Mapper<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