PurchaseItemsFormImpl.java

  1. // license-header java merge-point
  2. // Generated by andromda-jsf cartridge (forms\FormImpl.java.vsl)
  3. package my.onlinestore.purchase;

  4. import java.io.Serializable;
  5. import java.util.Collection;
  6. import java.util.Map;
  7. import javax.faces.model.SelectItem;
  8. import javax.validation.constraints.NotNull;
  9. import org.apache.commons.beanutils.ConvertUtils;
  10. import org.apache.commons.lang.StringUtils;
  11. import org.apache.myfaces.extensions.validator.baseval.annotation.Pattern;

  12. /**
  13.  * <p>
  14.  * TODO: Model Documentation for my.onlinestore.purchase.prompt user for name and password
  15.  * </p>
  16.  */
  17. public class PurchaseItemsFormImpl
  18.     implements Serializable, LoadLanguagesForm
  19. {
  20.     /**
  21.      * Default constructor
  22.      */
  23.     public PurchaseItemsFormImpl()
  24.     {
  25.     }

  26.     // Action purchase-items-prompt-user-for-name-and-password formFields
  27.     private String id;

  28.     /**
  29.      * <p>
  30.      * TODO: Model Documentation for id
  31.      * </p>
  32.      *
  33.      * @return id <p>
  34. TODO: Model Documentation for id
  35. </p>
  36.      */
  37.     public String getId()
  38.     {
  39.         return this.id;
  40.     }

  41.     /**
  42.      * Keeps track of whether or not the value of id has
  43.      * be populated at least once.
  44.      */
  45.     private boolean idSet = false;

  46.     /**
  47.      * Indicates whether or not the value for id has been set at least
  48.      * once.
  49.      *
  50.      * @return true/false
  51.      */
  52.     public boolean isIdSet()
  53.     {
  54.         return this.idSet;
  55.     }

  56.     /**
  57.      * <p>
  58.      * TODO: Model Documentation for id
  59.      * </p>
  60.      *
  61.      * @param idIn <p>
  62. TODO: Model Documentation for id
  63. </p>
  64.      */
  65.     public void setId(String idIn)
  66.     {
  67.         this.id = StringUtils.trimToNull(idIn);
  68.         this.idSet = true;
  69.     }

  70.     /**
  71.      * Stores the label/value pairs.
  72.      */
  73.     private Collection<SelectItem> idBackingList;


  74.     /**
  75.      * @return backingList Collection<SelectItem>
  76.      */
  77.     public Collection<SelectItem> getIdBackingList()
  78.     {
  79.         return idBackingList;
  80.     }

  81.     /**
  82.      * @param idBackingListIn
  83.      */
  84.     public void setIdBackingList(Collection<SelectItem> idBackingListIn)
  85.     {
  86.         this.idBackingList = idBackingListIn;
  87.     }
  88.    

  89.     private String publisher;

  90.     /**
  91.      * <p>
  92.      * TODO: Model Documentation for publisher
  93.      * </p>
  94.      *
  95.      * @return publisher <p>
  96. TODO: Model Documentation for publisher
  97. </p>
  98.      */
  99.     public String getPublisher()
  100.     {
  101.         return this.publisher;
  102.     }

  103.     /**
  104.      * Keeps track of whether or not the value of publisher has
  105.      * be populated at least once.
  106.      */
  107.     private boolean publisherSet = false;

  108.     /**
  109.      * Indicates whether or not the value for publisher has been set at least
  110.      * once.
  111.      *
  112.      * @return true/false
  113.      */
  114.     public boolean isPublisherSet()
  115.     {
  116.         return this.publisherSet;
  117.     }

  118.     /**
  119.      * <p>
  120.      * TODO: Model Documentation for publisher
  121.      * </p>
  122.      *
  123.      * @param publisherIn <p>
  124. TODO: Model Documentation for publisher
  125. </p>
  126.      */
  127.     public void setPublisher(String publisherIn)
  128.     {
  129.         this.publisher = StringUtils.trimToNull(publisherIn);
  130.         this.publisherSet = true;
  131.     }

  132.     /**
  133.      * Stores the label/value pairs.
  134.      */
  135.     private Collection<SelectItem> publisherBackingList;


  136.     /**
  137.      * @return backingList Collection<SelectItem>
  138.      */
  139.     public Collection<SelectItem> getPublisherBackingList()
  140.     {
  141.         return publisherBackingList;
  142.     }

  143.     /**
  144.      * @param publisherBackingListIn
  145.      */
  146.     public void setPublisherBackingList(Collection<SelectItem> publisherBackingListIn)
  147.     {
  148.         this.publisherBackingList = publisherBackingListIn;
  149.     }
  150.    

  151.     @NotNull
  152.     @Pattern("^[a-zA-Z]{3,}$")
  153.     private String name;

  154.     /**
  155.      * <p>
  156.      * This name is required and must consist of at least three alphabetical characters
  157.      * </p>
  158.      *
  159.      * @return name <p>
  160. This name is required and must consist of at least three alphabetical characters
  161. </p>
  162.      */
  163.     public String getName()
  164.     {
  165.         return this.name;
  166.     }

  167.     /**
  168.      * Keeps track of whether or not the value of name has
  169.      * be populated at least once.
  170.      */
  171.     private boolean nameSet = false;

  172.     /**
  173.      * Indicates whether or not the value for name has been set at least
  174.      * once.
  175.      *
  176.      * @return true/false
  177.      */
  178.     public boolean isNameSet()
  179.     {
  180.         return this.nameSet;
  181.     }

  182.     /**
  183.      * <p>
  184.      * This name is required and must consist of at least three alphabetical characters
  185.      * </p>
  186.      *
  187.      * @param nameIn <p>
  188. This name is required and must consist of at least three alphabetical characters
  189. </p>
  190.      */
  191.     public void setName(String nameIn)
  192.     {
  193.         this.name = StringUtils.trimToNull(nameIn);
  194.         this.nameSet = true;
  195.     }

  196.     /**
  197.      * Stores the label/value pairs.
  198.      */
  199.     private Collection<SelectItem> nameBackingList;


  200.     /**
  201.      * @return backingList Collection<SelectItem>
  202.      */
  203.     public Collection<SelectItem> getNameBackingList()
  204.     {
  205.         return nameBackingList;
  206.     }

  207.     /**
  208.      * @param nameBackingListIn
  209.      */
  210.     public void setNameBackingList(Collection<SelectItem> nameBackingListIn)
  211.     {
  212.         this.nameBackingList = nameBackingListIn;
  213.     }
  214.    

  215.     @Pattern("^[a-zA-Z0-9]{6,}$")
  216.     @NotNull
  217.     private String password;

  218.     /**
  219.      * <p>
  220.      * This password is required and must consist of at least six alphanumerical characters, the
  221.      * characters you type will be hidden behind a '*' (asterisk).
  222.      * </p>
  223.      *
  224.      * @return password <p>
  225. This password is required and must consist of at least six alphanumerical characters, the characters
  226. you type will be hidden behind a '*' (asterisk).
  227. </p>
  228.      */
  229.     public String getPassword()
  230.     {
  231.         return this.password;
  232.     }

  233.     /**
  234.      * Keeps track of whether or not the value of password has
  235.      * be populated at least once.
  236.      */
  237.     private boolean passwordSet = false;

  238.     /**
  239.      * Indicates whether or not the value for password has been set at least
  240.      * once.
  241.      *
  242.      * @return true/false
  243.      */
  244.     public boolean isPasswordSet()
  245.     {
  246.         return this.passwordSet;
  247.     }

  248.     /**
  249.      * <p>
  250.      * This password is required and must consist of at least six alphanumerical characters, the
  251.      * characters you type will be hidden behind a '*' (asterisk).
  252.      * </p>
  253.      *
  254.      * @param passwordIn <p>
  255. This password is required and must consist of at least six alphanumerical characters, the characters
  256. you type will be hidden behind a '*' (asterisk).
  257. </p>
  258.      */
  259.     public void setPassword(String passwordIn)
  260.     {
  261.         this.password = StringUtils.trimToNull(passwordIn);
  262.         this.passwordSet = true;
  263.     }

  264.     /**
  265.      * Stores the label/value pairs.
  266.      */
  267.     private Collection<SelectItem> passwordBackingList;


  268.     /**
  269.      * @return backingList Collection<SelectItem>
  270.      */
  271.     public Collection<SelectItem> getPasswordBackingList()
  272.     {
  273.         return passwordBackingList;
  274.     }

  275.     /**
  276.      * @param passwordBackingListIn
  277.      */
  278.     public void setPasswordBackingList(Collection<SelectItem> passwordBackingListIn)
  279.     {
  280.         this.passwordBackingList = passwordBackingListIn;
  281.     }
  282.    

  283.    
  284.     @NotNull
  285.     private String confirmPassword;

  286.     /**
  287.      * <p>
  288.      * This field's value should match the one from the password field. This field is present to
  289.      * show that AndroMDA can render the proper conditional validation routines.
  290.      * </p>
  291.      *
  292.      * @return confirmPassword <p>
  293. This field's value should match the one from the password field. This field is present to show that
  294. AndroMDA can render the proper conditional validation routines.
  295. </p>
  296.      */
  297.     public String getConfirmPassword()
  298.     {
  299.         return this.confirmPassword;
  300.     }

  301.     /**
  302.      * Keeps track of whether or not the value of confirmPassword has
  303.      * be populated at least once.
  304.      */
  305.     private boolean confirmPasswordSet = false;

  306.     /**
  307.      * Indicates whether or not the value for confirmPassword has been set at least
  308.      * once.
  309.      *
  310.      * @return true/false
  311.      */
  312.     public boolean isConfirmPasswordSet()
  313.     {
  314.         return this.confirmPasswordSet;
  315.     }

  316.     /**
  317.      * <p>
  318.      * This field's value should match the one from the password field. This field is present to
  319.      * show that AndroMDA can render the proper conditional validation routines.
  320.      * </p>
  321.      *
  322.      * @param confirmPasswordIn <p>
  323. This field's value should match the one from the password field. This field is present to show that
  324. AndroMDA can render the proper conditional validation routines.
  325. </p>
  326.      */
  327.     public void setConfirmPassword(String confirmPasswordIn)
  328.     {
  329.         this.confirmPassword = StringUtils.trimToNull(confirmPasswordIn);
  330.         this.confirmPasswordSet = true;
  331.     }

  332.     /**
  333.      * Stores the label/value pairs.
  334.      */
  335.     private Collection<SelectItem> confirmPasswordBackingList;


  336.     /**
  337.      * @return backingList Collection<SelectItem>
  338.      */
  339.     public Collection<SelectItem> getConfirmPasswordBackingList()
  340.     {
  341.         return confirmPasswordBackingList;
  342.     }

  343.     /**
  344.      * @param confirmPasswordBackingListIn
  345.      */
  346.     public void setConfirmPasswordBackingList(Collection<SelectItem> confirmPasswordBackingListIn)
  347.     {
  348.         this.confirmPasswordBackingList = confirmPasswordBackingListIn;
  349.     }
  350.    

  351.     private String language;

  352.     /**
  353.      * <p>
  354.      * Select the language in which to continue.
  355.      * </p>
  356.      *
  357.      * @return language <p>
  358. Select the language in which to continue.
  359. </p>
  360.      */
  361.     public String getLanguage()
  362.     {
  363.         return this.language;
  364.     }

  365.     /**
  366.      * Keeps track of whether or not the value of language has
  367.      * be populated at least once.
  368.      */
  369.     private boolean languageSet = false;

  370.     /**
  371.      * Indicates whether or not the value for language has been set at least
  372.      * once.
  373.      *
  374.      * @return true/false
  375.      */
  376.     public boolean isLanguageSet()
  377.     {
  378.         return this.languageSet;
  379.     }

  380.     /**
  381.      * <p>
  382.      * Select the language in which to continue.
  383.      * </p>
  384.      *
  385.      * @param languageIn <p>
  386. Select the language in which to continue.
  387. </p>
  388.      */
  389.     public void setLanguage(String languageIn)
  390.     {
  391.         this.language = StringUtils.trimToNull(languageIn);
  392.         this.languageSet = true;
  393.     }

  394.     /**
  395.      * Stores the label/value pairs.
  396.      */
  397.     private Collection<SelectItem> languageBackingList;


  398.     /**
  399.      * @return backingList Collection<SelectItem>
  400.      */
  401.     public Collection<SelectItem> getLanguageBackingList()
  402.     {
  403.         return languageBackingList;
  404.     }

  405.     /**
  406.      * @param languageBackingListIn
  407.      */
  408.     public void setLanguageBackingList(Collection<SelectItem> languageBackingListIn)
  409.     {
  410.         this.languageBackingList = languageBackingListIn;
  411.     }
  412.    


  413.     /*
  414.      * Append this form's fields and values to a Map
  415.      *
  416.      * @param dest the destination Map
  417.      */  
  418.     public Map<String,Object> copyTo(Map<String,Object> dest)
  419.     {
  420.         if(this.idSet)
  421.         {
  422.             dest.put("id",this.id);
  423.         }
  424.         if(this.publisherSet)
  425.         {
  426.             dest.put("publisher",this.publisher);
  427.         }
  428.         if(this.nameSet)
  429.         {
  430.             dest.put("name",this.name);
  431.         }
  432.         if(this.passwordSet)
  433.         {
  434.             dest.put("password",this.password);
  435.         }
  436.         if(this.confirmPasswordSet)
  437.         {
  438.             dest.put("confirmPassword",this.confirmPassword);
  439.         }
  440.         if(this.languageSet)
  441.         {
  442.             dest.put("language",this.language);
  443.         }
  444.         return dest;
  445.     }

  446.     /*
  447.      * Fills this form using values of a Map
  448.      *
  449.      * @param source the source Map
  450.      */    
  451.      public PurchaseItemsFormImpl copyFrom(Map<String,Object> source)
  452.     {
  453.         if(source.containsKey("id"))
  454.         {
  455.             this.setId((String)ConvertUtils.convert(source.get("id"),String.class));
  456.         }
  457.         if(source.containsKey("publisher"))
  458.         {
  459.             this.setPublisher((String)ConvertUtils.convert(source.get("publisher"),String.class));
  460.         }
  461.         if(source.containsKey("name"))
  462.         {
  463.             this.setName((String)ConvertUtils.convert(source.get("name"),String.class));
  464.         }
  465.         if(source.containsKey("password"))
  466.         {
  467.             this.setPassword((String)ConvertUtils.convert(source.get("password"),String.class));
  468.         }
  469.         if(source.containsKey("confirmPassword"))
  470.         {
  471.             this.setConfirmPassword((String)ConvertUtils.convert(source.get("confirmPassword"),String.class));
  472.         }
  473.         if(source.containsKey("language"))
  474.         {
  475.             this.setLanguage((String)ConvertUtils.convert(source.get("language"),String.class));
  476.         }
  477.         return this;
  478.     }

  479.     /**
  480.      * The serial version UID of this class. Needed for serialization.
  481.      */
  482.     private static final long serialVersionUID = 3371686577269947117L;
  483. }