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.application;
6   
7   import java.util.List;
8   
9   import com.hack23.cia.model.application.dto.common.UserSessionDTO;
10  import com.hack23.cia.model.application.impl.common.Agency;
11  import com.hack23.cia.model.sweden.impl.CommitteeReport;
12  import com.hack23.cia.model.sweden.impl.PoliticalParty;
13  import com.hack23.cia.web.action.common.ControllerAction;
14  import com.hack23.cia.web.viewfactory.api.common.AbstractModelAndView;
15  
16  /***
17   * The Class ApplicationModelAndView.
18   */
19  public class ApplicationModelAndView extends AbstractModelAndView {
20  
21      /***
22       * The Enum ApplicationViewSpecification.
23       */
24      public enum ApplicationViewSpecification {
25  
26          /*** The Application view. */
27          ApplicationView
28      }
29  
30      /*** The Constant serialVersionUID. */
31      private static final long serialVersionUID = 1L;
32  
33      /*** The agency. */
34      private final Agency agency;
35  
36      /*** The application view specification. */
37      private final ApplicationViewSpecification applicationViewSpecification;
38  
39      /*** The committee reports. */
40      private final List<CommitteeReport> committeeReports;
41  
42  	/*** The political parties. */
43  	private final List<PoliticalParty> politicalParties;
44  
45      /***
46       * Instantiates a new application model and view.
47       *
48       * @param userSessionDTO the user session dto
49       * @param controllerAction the controller action
50       * @param applicationViewSpecification the application view specification
51       * @param agency the agency
52       * @param committeeReports the committee reports
53       * @param politicalParties the political parties
54       */
55      public ApplicationModelAndView(final UserSessionDTO userSessionDTO,
56              final ControllerAction controllerAction,
57              final ApplicationViewSpecification applicationViewSpecification,
58              final Agency agency, final List<CommitteeReport> committeeReports,final List<PoliticalParty> politicalParties) {
59          super(userSessionDTO, controllerAction);
60          this.applicationViewSpecification = applicationViewSpecification;
61          this.agency = agency;
62          this.committeeReports = committeeReports;
63  		this.politicalParties = politicalParties;
64      }
65  
66      /***
67       * Gets the agency.
68       *
69       * @return the agency
70       */
71      public final Agency getAgency() {
72          return agency;
73      }
74  
75      /***
76       * Gets the application view specification.
77       *
78       * @return the application view specification
79       */
80      public final ApplicationViewSpecification getApplicationViewSpecification() {
81          return applicationViewSpecification;
82      }
83  
84      /***
85       * Gets the committee reports.
86       *
87       * @return the committee reports
88       */
89      public final List<CommitteeReport> getCommitteeReports() {
90          return committeeReports;
91      }
92  
93      /***
94       * Gets the political parties.
95       *
96       * @return the political parties
97       */
98  	public final List<PoliticalParty> getPoliticalParties() {
99  		return politicalParties;
100 	}
101 
102 	/*
103      * (non-Javadoc)
104      * 
105      * @seecom.hack23.cia.web.viewfactory.api.common.AbstractModelAndView#
106      * getViewSpecificationDescription()
107      */
108     @Override
109     public final String getViewSpecificationDescription() {
110         return applicationViewSpecification.toString();
111     }
112 
113 }