1 56 57 package org.jdom; 58 59 67 public class DocType extends Content { 68 69 private static final String CVS_ID = 70 "@(#) $RCSfile: DocType.java,v $ $Revision: 1.31 $ $Date: 2004/02/27 11:32:57 $ $Name: $"; 71 72 73 protected String elementName; 74 75 76 protected String publicID; 77 78 79 protected String systemID; 80 81 82 protected String internalSubset; 83 84 87 protected DocType() {} 88 89 93 94 110 public DocType(String elementName, String publicID, String systemID) { 111 setElementName(elementName); 112 setPublicID(publicID); 113 setSystemID(systemID); 114 } 115 116 130 public DocType(String elementName, String systemID) { 131 this(elementName, null, systemID); 132 } 133 134 143 public DocType(String elementName) { 144 this(elementName, null, null); 145 } 146 147 152 public String getElementName() { 153 return elementName; 154 } 155 156 166 public DocType setElementName(String elementName) { 167 String reason = Verifier.checkXMLName(elementName); 170 if (reason != null) { 171 throw new IllegalNameException(elementName, "DocType", reason); 172 } 173 this.elementName = elementName; 174 return this; 175 } 176 177 184 public String getPublicID() { 185 return publicID; 186 } 187 188 197 public DocType setPublicID(String publicID) { 198 String reason = Verifier.checkPublicID(publicID); 199 if (reason != null) { 200 throw new IllegalDataException(publicID, "DocType", reason); 201 } 202 this.publicID = publicID; 203 204 return this; 205 } 206 207 214 public String getSystemID() { 215 return systemID; 216 } 217 218 228 public DocType setSystemID(String systemID) { 229 String reason = Verifier.checkSystemLiteral(systemID); 230 if (reason != null) { 231 throw new IllegalDataException(systemID, "DocType", reason); 232 } 233 this.systemID = systemID; 234 235 return this; 236 } 237 238 243 public String getValue() { 244 return ""; } 246 247 253 public void setInternalSubset(String newData) { 254 internalSubset = newData; 255 } 256 257 262 public String getInternalSubset() { 263 return internalSubset; 264 } 265 266 273 public String toString() { 274 return new StringBuffer () 275 .append("[DocType: ") 276 .append(new org.jdom.output.XMLOutputter().outputString(this)) 277 .append("]") 278 .toString(); 279 } 280 } 281 | Popular Tags |