com.univocity.api.io
Class StringReaderProvider

java.lang.Object
  extended by com.univocity.api.io.ReaderProvider
      extended by com.univocity.api.io.StringReaderProvider
All Implemented Interfaces:
ResourceProvider<Reader>

public class StringReaderProvider
extends ReaderProvider

A ReaderProvider for Strings. Use this to read data directly from a String that should be used as an input.

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
ReaderProvider

Constructor Summary
StringReaderProvider()
          Creates a new instance with an empty String.
StringReaderProvider(String string)
          Creates a new instance with a given String.
 
Method Summary
 StringReader getResource()
          Returns a new StringReader for reading the String provided in the constructor of this class or via the setString(String) method.
 void setString(String string)
          Assigns a new String to this ReaderProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringReaderProvider

public StringReaderProvider()
Creates a new instance with an empty String.


StringReaderProvider

public StringReaderProvider(String string)
Creates a new instance with a given String. null will be converted to "".

Parameters:
string - the String to be read when getResource() is called..
Method Detail

setString

public void setString(String string)
Assigns a new String to this ReaderProvider. null will be converted to "".

Parameters:
string - the String to be read when getResource() is called..

getResource

public StringReader getResource()
Returns a new StringReader for reading the String provided in the constructor of this class or via the setString(String) method.

Returns:
a new StringReader


Copyright © 2018 uniVocity Software Pty Ltd. All rights reserved.