1 57 58 package com.sun.org.apache.xerces.internal.xni.parser; 59 60 import com.sun.org.apache.xerces.internal.util.XMLInputSourceAdaptor; 61 import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; 62 63 import java.io.InputStream ; 64 import java.io.Reader ; 65 66 import javax.xml.transform.stream.StreamSource ; 67 68 82 public class XMLInputSource { 83 84 88 89 protected String fPublicId; 90 91 92 protected String fSystemId; 93 94 95 protected String fBaseSystemId; 96 97 98 protected InputStream fByteStream; 99 100 101 protected Reader fCharStream; 102 103 104 protected String fEncoding; 105 106 110 125 public XMLInputSource(String publicId, String systemId, 126 String baseSystemId) { 127 fPublicId = publicId; 128 fSystemId = systemId; 129 fBaseSystemId = baseSystemId; 130 } 132 139 public XMLInputSource(XMLResourceIdentifier resourceIdentifier) { 140 141 fPublicId = resourceIdentifier.getPublicId(); 142 fSystemId = resourceIdentifier.getLiteralSystemId(); 143 fBaseSystemId = resourceIdentifier.getBaseSystemId(); 144 } 146 161 public XMLInputSource(String publicId, String systemId, 162 String baseSystemId, InputStream byteStream, 163 String encoding) { 164 fPublicId = publicId; 165 fSystemId = systemId; 166 fBaseSystemId = baseSystemId; 167 fByteStream = byteStream; 168 fEncoding = encoding; 169 } 171 187 public XMLInputSource(String publicId, String systemId, 188 String baseSystemId, Reader charStream, 189 String encoding) { 190 fPublicId = publicId; 191 fSystemId = systemId; 192 fBaseSystemId = baseSystemId; 193 fCharStream = charStream; 194 fEncoding = encoding; 195 } 197 200 public XMLInputSource( StreamSource source ) { 201 fPublicId = source.getPublicId(); 202 fSystemId = source.getSystemId(); 203 fCharStream = source.getReader(); 204 fByteStream = source.getInputStream(); 205 } 206 207 211 216 public void setPublicId(String publicId) { 217 fPublicId = publicId; 218 } 220 221 public String getPublicId() { 222 return fPublicId; 223 } 225 230 public void setSystemId(String systemId) { 231 fSystemId = systemId; 232 } 234 235 public String getSystemId() { 236 return fSystemId; 237 } 239 244 public void setBaseSystemId(String baseSystemId) { 245 fBaseSystemId = baseSystemId; 246 } 248 249 public String getBaseSystemId() { 250 return fBaseSystemId; 251 } 253 262 public void setByteStream(InputStream byteStream) { 263 fByteStream = byteStream; 264 } 266 267 public InputStream getByteStream() { 268 return fByteStream; 269 } 271 282 public void setCharacterStream(Reader charStream) { 283 fCharStream = charStream; 284 } 286 287 public Reader getCharacterStream() { 288 return fCharStream; 289 } 291 296 public void setEncoding(String encoding) { 297 fEncoding = encoding; 298 } 300 301 public String getEncoding() { 302 return fEncoding; 303 } 305 308 public final XMLInputSourceAdaptor toSource() { 309 return new XMLInputSourceAdaptor(this); 310 } 311 } | Popular Tags |