1 package jodd.servlet; 2 3 import java.util.HashMap; 4 5 11 final class ActionData { 12 13 16 public ActionData() { 17 } 18 19 25 public ActionData(String path, String type) { 26 setPath(path); 27 setType(type); 28 setMethod(null); 29 } 30 31 37 public ActionData(String path, String type, String method) { 38 setPath(path); 39 setType(type); 40 setMethod(method); 41 } 42 43 45 private String path; 46 51 public void setPath(String v) { 52 path = v; 53 } 54 59 public String getPath() { 60 return path; 61 } 62 63 65 private String type; 66 72 public void setType(String v) { 73 type = v; 74 } 75 80 public String getType() { 81 return type; 82 } 83 84 86 private String method; 87 93 public void setMethod(String v) { 94 method = v; 95 } 96 101 public String getMethod() { 102 return method; 103 } 104 105 107 private ActionServlet action = null; 108 113 public void setAction(ActionServlet v) { 114 action = v; 115 } 116 121 public ActionServlet getAction() { 122 return action; 123 } 124 125 127 private HashMap forwards = new HashMap(); 128 129 138 public void putForwardPath(String name, String path, String redirect) { 139 Boolean rdrct = Boolean.FALSE; 140 if (redirect.equalsIgnoreCase("true")) { 141 rdrct = Boolean.TRUE; 142 } 143 forwards.put(name, new Object[] {path, rdrct}); 144 } 145 152 public String getForwardPath(String name) { 153 Object[] fwds = (Object[]) forwards.get(name); 154 if (fwds == null) { 155 return null; 156 } 157 return (String)(fwds[0]); 158 } 159 166 public boolean isForwardRedirect(String name) { 167 Object[] flag = (Object[]) forwards.get(name); 168 if (flag == null) { 169 return false; 170 } 171 Boolean b = (Boolean) (flag[1]); 172 return b.booleanValue(); 173 } 174 175 176 178 private HashMap parameters = new HashMap(); 179 180 186 public void putParameter(String name, String value) { 187 if (name == null) { 188 return; 189 } 190 parameters.put(name, value); 191 } 192 193 200 public String getParameter(String name) { 201 return (String) parameters.get(name); 202 } 203 204 } 205 | Popular Tags |