View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
3   	$Id
4   */
5   package com.hack23.cia.web.viewfactory.api.user;
6   
7   import java.util.List;
8   
9   import com.hack23.cia.model.application.dto.common.UserSessionDTO;
10  import com.hack23.cia.model.sweden.impl.Vote;
11  import com.hack23.cia.web.action.common.ControllerAction;
12  
13  /***
14   * The Class VotesModelAndView.
15   */
16  public class VotesModelAndView extends AbstractParliamentModelAndView {
17  
18      /***
19       * The Enum VotesViewSpecification.
20       */
21      public enum VotesViewSpecification {
22  
23          /*** The Ballot view. */
24          BallotView
25      }
26  
27      /*** The Constant serialVersionUID. */
28      private static final long serialVersionUID = 1L;
29  
30      /*** The votes. */
31      private final List<Vote> votes;
32  
33      /*** The votes view specification. */
34      private final VotesViewSpecification votesViewSpecification;
35  
36      /***
37       * Instantiates a new votes model and view.
38       *
39       * @param userSessionDTO the user session dto
40       * @param controllerAction the controller action
41       * @param votesViewSpecification the votes view specification
42       * @param votes the votes
43       */
44      public VotesModelAndView(final UserSessionDTO userSessionDTO,
45              final ControllerAction controllerAction,
46              final VotesViewSpecification votesViewSpecification,
47              final List<Vote> votes) {
48          super(userSessionDTO, controllerAction);
49          this.votesViewSpecification = votesViewSpecification;
50          this.votes = votes;
51      }
52  
53      /*
54       * (non-Javadoc)
55       * 
56       * @seecom.hack23.cia.web.viewfactory.api.common.AbstractModelAndView#
57       * getViewSpecificationDescription()
58       */
59      @Override
60      public final String getViewSpecificationDescription() {
61          return votesViewSpecification.toString();
62      }
63  
64      /***
65       * Gets the votes.
66       *
67       * @return the votes
68       */
69      public final List<Vote> getVotes() {
70          return votes;
71      }
72  
73      /***
74       * Gets the votes view specification.
75       *
76       * @return the votes view specification
77       */
78      public final VotesViewSpecification getVotesViewSpecification() {
79          return votesViewSpecification;
80      }
81  }