WelcomeViewPopulator.java
package org.andromda.samples.carrental.welcome;
import java.util.Map;
/**
* Provides the ability to populate any view in the welcome
*/
public final class WelcomeViewPopulator
{
/**
* Populate page variables for view Show Welcome
*
* @param fromForm origin form
* @param pageVariables the page variables
*/
public static void populateShowWelcomePageVariables(Object fromForm, Map<String,Object> pageVariables)
{
if(fromForm instanceof WelcomeFormImpl)
{
final WelcomeFormImpl sourceForm=(WelcomeFormImpl)fromForm;
if(sourceForm.isWelcomeMessageSet())
{
pageVariables.put("welcomeMessage",sourceForm.getWelcomeMessage());
}
}
}
}