net.sf.taverna.t2.util.beanable
Interface Beanable<Bean>

Type Parameters:
Bean - A simple JavaBean class which contains the required information

public interface Beanable<Bean>

Anything which you want to serialise with BeanSerialiser should implement this interface. Expose required information as a bean from getAsBean(), which can later be set using setFromBean(Object).

Author:
Ian Dunlop, Stian Soiland
See Also:
BeanSerialiser

Method Summary
 Bean getAsBean()
          Expose as a serialisable bean.
 void setFromBean(Bean bean)
          Set values from bean.
 

Method Detail

getAsBean

Bean getAsBean()
Expose as a serialisable bean. This is not necessarily the same bean as set with setFromBean(Object).

Returns:
The bean to be serialised

setFromBean

void setFromBean(Bean bean)
                 throws java.lang.IllegalArgumentException
Set values from bean. Implementations can either copy the values from the bean or keep it internally. Note that setFromBean(Object) can only be called once, and only after constructing the bean with the empty constructor.

Parameters:
bean - Previously serialised bean
Throws:
java.lang.IllegalArgumentException