View Javadoc

1   /*
2    * Copyright (c) 2005-2007 Creative Sphere Limited.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *
10   *   Creative Sphere - initial API and implementation
11   *
12   */
13  package org.abstracthorizon.danube.mvc;
14  
15  import java.util.Map;
16  
17  /**
18   * Simple class that combines model and view.
19   * Based on {@link org.springframework.web.servlet.ModelAndView}
20   *
21   * @author Daniel Sendula
22   *
23   * @assoc - - - org.abstracthorizon.danube.mvc.Controller
24   * @assoc - - - org.abstracthorizon.danube.mvc.View
25   */
26  public class ModelAndView {
27  
28      /** View name */
29      protected String view;
30  
31      /** Map that represents the model */
32      protected Map<? extends Object, ? extends Object> model;
33  
34      /**
35       * Constructor
36       * @param view view name
37       * @param model map that represents the model
38       */
39      public ModelAndView(String view, Map<? extends Object, ? extends Object> model) {
40          this.view = view;
41          this.model = model;
42      }
43  
44      /**
45       * Returns view name
46       * @return view name
47       */
48      public String getView() {
49          return view;
50      }
51  
52      /**
53       * Returns model as an map
54       * @return model as an map
55       */
56      public Map<? extends Object, ? extends Object> getModel() {
57          return model;
58      }
59  }