org.dellroad.stuff.spring
Class ResourceReaderFactoryBean

java.lang.Object
  extended by org.springframework.beans.factory.config.AbstractFactoryBean<String>
      extended by org.dellroad.stuff.spring.ResourceReaderFactoryBean
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<String>, InitializingBean

public class ResourceReaderFactoryBean
extends AbstractFactoryBean<String>

Spring factory bean that reads in a Spring Resource and converts it to a String.


Field Summary
 
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
 
Constructor Summary
ResourceReaderFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  String createInstance()
           
 Class<String> getObjectType()
           
 void setCharacterEncoding(String charset)
          Configure the character encoding for the resource.
 void setResource(Resource resource)
          Configure the resource containing the value.
 
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceReaderFactoryBean

public ResourceReaderFactoryBean()
Method Detail

setResource

public void setResource(Resource resource)
Configure the resource containing the value.


setCharacterEncoding

public void setCharacterEncoding(String charset)
Configure the character encoding for the resource. Default is UTF-8.


getObjectType

public Class<String> getObjectType()
Specified by:
getObjectType in interface FactoryBean<String>
Specified by:
getObjectType in class AbstractFactoryBean<String>

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class AbstractFactoryBean<String>
Throws:
Exception

createInstance

protected String createInstance()
                         throws IOException
Specified by:
createInstance in class AbstractFactoryBean<String>
Throws:
IOException