1 package example; 2 3 import java.util.*; 4 5 public class Page { 6 private String template; 7 private String forward; 8 private Map root = new HashMap(); 9 10 public String getTemplate() { 11 return template; 12 } 13 14 public void setTemplate(String template) { 15 forward = null; 16 this.template = template; 17 } 18 19 public void put(String name, Object value) { 20 root.put(name, value); 21 } 22 23 public void put(String name, int value) { 24 root.put(name, new Integer (value)); 25 } 26 27 public void put(String name, double value) { 28 root.put(name, new Double (value)); 29 } 30 31 public void put(String name, boolean value) { 32 root.put(name, new Boolean (value)); 33 } 34 35 public Map getRoot() { 36 return root; 37 } 38 39 public String getForward() { 40 return forward; 41 } 42 43 public void setForward(String forward) { 44 template = null; 45 this.forward = forward; 46 } 47 48 } 49 | Popular Tags |