1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 62 import java.io.OutputStream ; 63 import java.io.PrintWriter ; 64 import java.io.IOException ; 65 import java.io.ByteArrayOutputStream ; 66 import java.io.BufferedOutputStream ; 67 import java.util.Enumeration ; 68 import java.util.Vector ; 69 import org.apache.ecs.storage.Hash; 70 71 78 public class comment extends MultiPartElement implements Printable 79 { 80 81 84 { 85 setElementType("--"); 86 setCase(LOWERCASE); 87 setAttributeQuote(true); 88 setBeginStartModifier('!'); 89 } 90 91 94 public comment() 95 { 96 } 97 98 101 public comment(String element) 102 { 103 addElement(element); 104 } 105 106 109 public comment(Element element) 110 { 111 addElement(element); 112 } 113 114 118 public Element setLang(String lang) 119 { 120 addAttribute("lang",lang); 121 addAttribute("xml:lang",lang); 122 return this; 123 } 124 125 130 public comment addElement(String hashcode,Element element) 131 { 132 addElementToRegistry(hashcode,element); 133 return(this); 134 } 135 136 141 public comment addElement(String hashcode,String element) 142 { 143 addElementToRegistry(hashcode,element); 144 return(this); 145 } 146 147 151 public comment addElement(Element element) 152 { 153 addElementToRegistry(element); 154 return(this); 155 } 156 160 public comment addElement(String element) 161 { 162 addElementToRegistry(element); 163 return(this); 164 } 165 169 public comment removeElement(String hashcode) 170 { 171 removeElementFromRegistry(hashcode); 172 return(this); 173 } 174 175 public String createStartTag() 176 { 177 setEndTagChar(' '); 178 StringBuffer out = new StringBuffer (); 179 out.append(getStartTagChar()); 180 181 if(getBeginStartModifierDefined()) 182 { 183 out.append(getBeginStartModifier()); 184 } 185 out.append(getElementType()); 186 187 if(getBeginEndModifierDefined()) 188 { 189 out.append(getBeginEndModifier()); 190 } 191 out.append(getEndTagChar()); 192 193 setEndTagChar('>'); return(out.toString()); 195 } 196 197 public String createEndTag() 198 { 199 StringBuffer out = new StringBuffer (); 200 setStartTagChar(' '); 201 setEndStartModifier(' '); 202 203 out.append(getStartTagChar()); 204 205 if(getEndStartModifierDefined()) 206 { 207 out.append(getEndStartModifier()); 208 } 209 out.append(getElementType()); 210 211 if(getEndEndModifierDefined()) 212 { 213 out.append(getEndEndModifier()); 214 } 215 out.append(getEndTagChar()); 216 setStartTagChar('<'); 218 return(out.toString()); 219 } 220 } 221 | Popular Tags |