WelcomeFormImpl.java

// license-header java merge-point
// Generated by andromda-jsf cartridge (forms\FormImpl.java.vsl)
package org.andromda.samples.carrental.welcome;

import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import javax.faces.model.SelectItem;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.lang.StringUtils;

/**
 * <p>
 * TODO: Model Documentation for org.andromda.samples.carrental.welcome.Welcome Start
 * </p>
 */
public class WelcomeFormImpl
    implements Serializable
{
    /**
     * Default constructor
     */
    public WelcomeFormImpl()
    {
    }

    // Action welcome-welcome-start formFields
    private String welcomeMessage;

    /**
     * <p>
     * send the welcome message to the initial screen
     * </p>
     *
     * @return welcomeMessage <p>
send the welcome message to the initial screen
</p>
     */
    public String getWelcomeMessage()
    {
        return this.welcomeMessage;
    }

    /**
     * Keeps track of whether or not the value of welcomeMessage has
     * be populated at least once.
     */
    private boolean welcomeMessageSet = false;

    /**
     * Indicates whether or not the value for welcomeMessage has been set at least
     * once.
     *
     * @return true/false
     */
    public boolean isWelcomeMessageSet()
    {
        return this.welcomeMessageSet;
    }

    /**
     * <p>
     * send the welcome message to the initial screen
     * </p>
     *
     * @param welcomeMessageIn <p>
send the welcome message to the initial screen
</p>
     */
    public void setWelcomeMessage(String welcomeMessageIn)
    {
        this.welcomeMessage = StringUtils.trimToNull(welcomeMessageIn);
        this.welcomeMessageSet = true;
    }

    /**
     * Stores the label/value pairs.
     */
    private Collection<SelectItem> welcomeMessageBackingList;


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getWelcomeMessageBackingList()
    {
        return welcomeMessageBackingList;
    }

    /**
     * @param welcomeMessageBackingListIn
     */
    public void setWelcomeMessageBackingList(Collection<SelectItem> welcomeMessageBackingListIn)
    {
        this.welcomeMessageBackingList = welcomeMessageBackingListIn;
    }
    


    /*
     * Append this form's fields and values to a Map
     *
     * @param dest the destination Map
     */  
    public Map<String,Object> copyTo(Map<String,Object> dest)
    {
        if(this.welcomeMessageSet)
        {
            dest.put("welcomeMessage",this.welcomeMessage);
        }
        return dest;
    }

    /*
     * Fills this form using values of a Map
     *
     * @param source the source Map
     */     
     public WelcomeFormImpl copyFrom(Map<String,Object> source)
    {
        if(source.containsKey("welcomeMessage"))
        {
            this.setWelcomeMessage((String)ConvertUtils.convert(source.get("welcomeMessage"),String.class));
        }
        return this;
    }

    /**
     * The serial version UID of this class. Needed for serialization.
     */
    private static final long serialVersionUID = 2825605416427529064L;
}