1 17 18 package javax.servlet.jsp.tagext; 19 20 import java.util.Hashtable ; 21 22 30 31 public class TagData implements Cloneable { 32 33 38 39 public static final Object REQUEST_TIME_VALUE = new Object (); 40 41 42 57 public TagData(Object [] atts[]) { 58 if (atts == null) { 59 attributes = new Hashtable <String , Object >(); 60 } else { 61 attributes = new Hashtable <String , Object >(atts.length); 62 } 63 64 if (atts != null) { 65 for (int i = 0; i < atts.length; i++) { 66 attributes.put((String ) atts[i][0], atts[i][1]); 67 } 68 } 69 } 70 71 79 public TagData(Hashtable <String , Object > attrs) { 80 this.attributes = attrs; 81 } 82 83 89 90 public String getId() { 91 return getAttributeString(TagAttributeInfo.ID); 92 } 93 94 109 110 public Object getAttribute(String attName) { 111 return attributes.get(attName); 112 } 113 114 120 public void setAttribute(String attName, 121 Object value) { 122 attributes.put(attName, value); 123 } 124 125 132 133 public String getAttributeString(String attName) { 134 Object o = attributes.get(attName); 135 if (o == null) { 136 return null; 137 } else { 138 return (String ) o; 139 } 140 } 141 142 147 public java.util.Enumeration <String > getAttributes() { 148 return attributes.keys(); 149 }; 150 151 153 private Hashtable <String , Object > attributes; } 155 | Popular Tags |