com.sri.emo.wizard
Interface WizardMementoConverter

All Known Implementing Classes:
CompletionMementoConverter, CreationMementoConverter

public interface WizardMementoConverter

This interface is for controllers to allow Wizards to be transformed between usable wizards and opaque serializable objects that are meant to be as 'slim' as possible. Ex:

 request.getSession().setPersistentAttribute("MyWizardKey", mementoConverter.toMomento(myWizard));
 

and

//Cast to serializable is necessary because session says it needs objects, //even though it really needs Serializable. Wizard myWizard = myMementoConverter.fromMemento((Serializable)request.getSession().getPersistentAttribute("MyWizardKey"));

Version:
1.0
Author:
Michael Rimov

Method Summary
 Wizard fromMemento(Serializable previouslyExternalized)
          Re-fleshes out the wizard into usable forms.
 Serializable toMemento(Wizard target)
          Breaks the wizard down into minimal component state parts that can be stored in the session or client.
 

Method Detail

toMemento

Serializable toMemento(Wizard target)
                       throws WizardException
Breaks the wizard down into minimal component state parts that can be stored in the session or client. Similar to the dehydration process in the natural -- all the fluff is removed. Implementations do not have to do anything with the underlying wizard, they may just return the wizard proper if everything is properly serializable.

Parameters:
target - Wizard the wizard being 'dehydrated'
Returns:
Serializable
Throws:
WizardException

fromMemento

Wizard fromMemento(Serializable previouslyExternalized)
                   throws WizardException
Re-fleshes out the wizard into usable forms. Again, the underlying factory implementation may not do anything with it. It doesn't really matter in the end.

Parameters:
previouslyExternalized - Serializable
Returns:
Wizard
Throws:
WizardException


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.