1 58 package org.apache.ecs; 59 60 import java.io.OutputStream ; 61 import java.io.PrintWriter ; 62 63 71 public class StringElement extends ConcreteElement implements Printable 72 { 73 76 public StringElement() 77 { 78 } 79 80 83 public StringElement(String string) 84 { 85 if (string != null) 86 setTagText(string); 87 else 88 setTagText(""); 89 } 90 91 94 public StringElement(Element element) 95 { 96 addElement(element); 97 } 98 99 private StringElement append(String string) 100 { 101 setTagText(getTagText()+string); 102 return this; 103 } 104 105 108 public StringElement reset() 109 { 110 setTagText(""); 111 return this; 112 } 113 114 119 public StringElement addElement(String hashcode,Element element) 120 { 121 addElementToRegistry(hashcode,element); 122 return(this); 123 } 124 125 130 public StringElement addElement(String hashcode,String element) 131 { 132 137 StringElement se = new StringElement(element); 138 se.setFilterState(getFilterState()); 139 se.setFilter(getFilter()); 140 addElementToRegistry(hashcode,se); 141 return(this); 142 } 143 144 148 public StringElement addElement(String element) 149 { 150 addElement(Integer.toString(element.hashCode()),element); 151 return(this); 152 } 153 154 158 public StringElement addElement(Element element) 159 { 160 addElementToRegistry(element); 161 return(this); 162 } 163 164 168 public StringElement removeElement(String hashcode) 169 { 170 removeElementFromRegistry(hashcode); 171 return(this); 172 } 173 174 public String createStartTag() 175 { 176 return(""); 177 } 178 public String createEndTag() 179 { 180 return(""); 181 } 182 } 183 | Popular Tags |