home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / jaxp.jar / javax / xml / parsers / DocumentBuilder.class (.txt) next >
Encoding:
Java Class File  |  2000-02-23  |  1.5 KB  |  60 lines

  1. package javax.xml.parsers;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5. import java.io.InputStream;
  6. import org.w3c.dom.Document;
  7. import org.xml.sax.EntityResolver;
  8. import org.xml.sax.ErrorHandler;
  9. import org.xml.sax.InputSource;
  10. import org.xml.sax.SAXException;
  11.  
  12. public abstract class DocumentBuilder {
  13.    protected DocumentBuilder() {
  14.    }
  15.  
  16.    public abstract boolean isNamespaceAware();
  17.  
  18.    public abstract boolean isValidating();
  19.  
  20.    public abstract Document newDocument();
  21.  
  22.    public Document parse(File var1) throws SAXException, IOException {
  23.       if (var1 == null) {
  24.          throw new IllegalArgumentException("File cannot be null");
  25.       } else {
  26.          String var2 = "file:" + var1.getAbsolutePath();
  27.          if (File.separatorChar == '\\') {
  28.             var2 = var2.replace('\\', '/');
  29.          }
  30.  
  31.          InputSource var3 = new InputSource(var2);
  32.          return this.parse(var3);
  33.       }
  34.    }
  35.  
  36.    public Document parse(InputStream var1) throws SAXException, IOException {
  37.       if (var1 == null) {
  38.          throw new IllegalArgumentException("InputStream cannot be null");
  39.       } else {
  40.          InputSource var2 = new InputSource(var1);
  41.          return this.parse(var2);
  42.       }
  43.    }
  44.  
  45.    public Document parse(String var1) throws SAXException, IOException {
  46.       if (var1 == null) {
  47.          throw new IllegalArgumentException("URI cannot be null");
  48.       } else {
  49.          InputSource var2 = new InputSource(var1);
  50.          return this.parse(var2);
  51.       }
  52.    }
  53.  
  54.    public abstract Document parse(InputSource var1) throws SAXException, IOException;
  55.  
  56.    public abstract void setEntityResolver(EntityResolver var1);
  57.  
  58.    public abstract void setErrorHandler(ErrorHandler var1);
  59. }
  60.