org.szegedi.spring.core.io
Class BeanResourceRepresentation

java.lang.Object
  extended by org.szegedi.spring.core.io.ResourceRepresentation
      extended by org.szegedi.spring.core.io.PropertyResourceRepresentation
          extended by org.szegedi.spring.core.io.BeanResourceRepresentation

public abstract class BeanResourceRepresentation
extends PropertyResourceRepresentation

A resource representation that treats the resource as a Java properties file and represents the resource with a bean initialized with those properties.

Version:
$Id: $
Author:
Attila Szegedi

Constructor Summary
protected BeanResourceRepresentation(org.springframework.core.io.Resource resource)
           
 
Method Summary
protected abstract  java.lang.Object instantiateBean()
          Implement in a subclass to create an uninitialized bean.
protected  java.lang.Object loadRepresentation(java.io.InputStream in)
          Implement in subclasses to load the representation of the resource.
 
Methods inherited from class org.szegedi.spring.core.io.ResourceRepresentation
getRepresentation, getRepresentation, getResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanResourceRepresentation

protected BeanResourceRepresentation(org.springframework.core.io.Resource resource)
Method Detail

instantiateBean

protected abstract java.lang.Object instantiateBean()
Implement in a subclass to create an uninitialized bean.

Returns:
a new bean representing this resource.

loadRepresentation

protected java.lang.Object loadRepresentation(java.io.InputStream in)
                                       throws java.io.IOException
Description copied from class: ResourceRepresentation
Implement in subclasses to load the representation of the resource.

Overrides:
loadRepresentation in class PropertyResourceRepresentation
Parameters:
in - the input stream with resource bytes
Returns:
the object representing the resource.
Throws:
java.io.IOException