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 com.hack23.cia.model.application.dto.common.UserSessionDTO;
8   import com.hack23.cia.web.action.common.ControllerAction;
9   
10  /***
11   * The Class UrlModelAndView.
12   */
13  public class UrlModelAndView extends AbstractUserModelAndView {
14  
15      /***
16       * The Enum UrlViewSpecification.
17       */
18      public enum UrlViewSpecification {
19  
20          /*** The Url view. */
21          UrlView
22      }
23  
24      /*** The Constant serialVersionUID. */
25      private static final long serialVersionUID = 1L;
26  
27      /*** The title. */
28      private final String title;
29  
30      /*** The url. */
31      private final String url;
32  
33      /*** The url view specification. */
34      private final UrlViewSpecification urlViewSpecification;
35  
36      /***
37       * Instantiates a new url model and view.
38       *
39       * @param userSessionDTO the user session dto
40       * @param controllerAction the controller action
41       * @param urlViewSpecification the url view specification
42       * @param title the title
43       * @param url the url
44       */
45      public UrlModelAndView(final UserSessionDTO userSessionDTO,
46              final ControllerAction controllerAction,
47              final UrlViewSpecification urlViewSpecification,
48              final String title, final String url) {
49          super(userSessionDTO, controllerAction);
50          this.urlViewSpecification = urlViewSpecification;
51          this.title = title;
52          this.url = url;
53      }
54  
55      /***
56       * Gets the title.
57       *
58       * @return the title
59       */
60      public final String getTitle() {
61          return title;
62      }
63  
64      /***
65       * Gets the url.
66       *
67       * @return the url
68       */
69      public final String getUrl() {
70          return url;
71      }
72  
73      /***
74       * Gets the url view specification.
75       *
76       * @return the url view specification
77       */
78      public final UrlViewSpecification getUrlViewSpecification() {
79          return urlViewSpecification;
80      }
81  
82      /*
83       * (non-Javadoc)
84       * 
85       * @seecom.hack23.cia.web.viewfactory.api.common.AbstractModelAndView#
86       * getViewSpecificationDescription()
87       */
88      @Override
89      public final String getViewSpecificationDescription() {
90          return urlViewSpecification.toString();
91      }
92  
93  }