1 5 package com.opensymphony.webwork.views.jsp.ui; 6 7 import com.opensymphony.webwork.views.jsp.ParamTag; 8 9 import javax.servlet.jsp.tagext.BodyTagSupport ; 10 import java.util.Calendar ; 11 import java.util.Date ; 12 import java.util.HashMap ; 13 import java.util.Map ; 14 15 16 22 public class MockTag extends BodyTagSupport implements ParamTag.Parametric { 23 25 private static String s; 26 private static Integer i; 27 private static Double d; 28 private static Long l; 29 private static Float f; 30 private static Date date; 31 private static Calendar cal; 32 private static HashMap params; 33 private static MockTag instance = new MockTag(); 34 35 37 public static MockTag getInstance() { 38 return instance; 39 } 40 41 public void setCal(Calendar cal) { 42 MockTag.cal = cal; 43 } 44 45 public Calendar getCal() { 46 return cal; 47 } 48 49 public void setDate(Date date) { 50 MockTag.date = date; 51 } 52 53 public Date getDate() { 54 return date; 55 } 56 57 public void setDouble(Double d) { 58 MockTag.d = d; 59 } 60 61 public Double getDouble() { 62 return d; 63 } 64 65 public void setFloat(Float f) { 66 MockTag.f = f; 67 } 68 69 public Float getFloat() { 70 return f; 71 } 72 73 public void setInteger(Integer i) { 74 MockTag.i = i; 75 } 76 77 public Integer getInteger() { 78 return i; 79 } 80 81 public void setLong(Long l) { 82 MockTag.l = l; 83 } 84 85 public Long getLong() { 86 return l; 87 } 88 89 public Map getParameters() { 90 return this.params; 91 } 92 93 public void setString(String s) { 94 MockTag.s = s; 95 } 96 97 public String getString() { 98 return s; 99 } 100 101 public void addParameter(String key, Object value) { 102 this.params.put(key, value); 103 } 104 105 108 public void reset() { 109 s = null; 110 i = null; 111 l = null; 112 f = null; 113 date = null; 114 cal = null; 115 params = new HashMap (); 116 } 117 } 118 | Popular Tags |