net.sourceforge.pmd.util.datasource
Class ReaderDataSource

java.lang.Object
  extended by net.sourceforge.pmd.util.datasource.ReaderDataSource
All Implemented Interfaces:
DataSource

public class ReaderDataSource
extends Object
implements DataSource

DataSource implementation to read data from a Reader.


Constructor Summary
ReaderDataSource(Reader reader, String dataSourceName)
          Create the DataSource from the Reader.
 
Method Summary
 String getDataSourceName()
           
 InputStream getInputStream()
          Convert the Reader into an InputStream.
 String getNiceFileName(boolean shortNames, String inputFileName)
          Return the dataSourceName via the DataSource Interface method.
 void setDataSourceName(String dataSourceName)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReaderDataSource

public ReaderDataSource(Reader reader,
                        String dataSourceName)
Create the DataSource from the Reader.

Method Detail

getInputStream

public InputStream getInputStream()
                           throws IOException
Convert the Reader into an InputStream.

Note: This uses the default encoding.

Specified by:
getInputStream in interface DataSource
Returns:
Derived InputStream
Throws:
IOException

getNiceFileName

public String getNiceFileName(boolean shortNames,
                              String inputFileName)
Return the dataSourceName via the DataSource Interface method.

Both the parameters are ignored

Specified by:
getNiceFileName in interface DataSource
Parameters:
shortNames - ignored
inputFileName - ignored
Returns:

getDataSourceName

public String getDataSourceName()
Returns:
the dataSourceName

setDataSourceName

public void setDataSourceName(String dataSourceName)
Parameters:
dataSourceName - the dataSourceName to set

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2015 InfoEther. All Rights Reserved.