home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / xml-apis.jar / javax / xml / parsers / DocumentBuilder.class (.txt) next >
Encoding:
Java Class File  |  2003-11-18  |  1.5 KB  |  71 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.DOMImplementation;
  7. import org.w3c.dom.Document;
  8. import org.xml.sax.EntityResolver;
  9. import org.xml.sax.ErrorHandler;
  10. import org.xml.sax.InputSource;
  11. import org.xml.sax.SAXException;
  12.  
  13. public abstract class DocumentBuilder {
  14.    private static final boolean DEBUG = false;
  15.  
  16.    protected DocumentBuilder() {
  17.    }
  18.  
  19.    public Document parse(InputStream var1) throws SAXException, IOException {
  20.       if (var1 == null) {
  21.          throw new IllegalArgumentException("InputStream cannot be null");
  22.       } else {
  23.          InputSource var2 = new InputSource(var1);
  24.          return this.parse(var2);
  25.       }
  26.    }
  27.  
  28.    public Document parse(InputStream var1, String var2) throws SAXException, IOException {
  29.       if (var1 == null) {
  30.          throw new IllegalArgumentException("InputStream cannot be null");
  31.       } else {
  32.          InputSource var3 = new InputSource(var1);
  33.          var3.setSystemId(var2);
  34.          return this.parse(var3);
  35.       }
  36.    }
  37.  
  38.    public Document parse(String var1) throws SAXException, IOException {
  39.       if (var1 == null) {
  40.          throw new IllegalArgumentException("URI cannot be null");
  41.       } else {
  42.          InputSource var2 = new InputSource(var1);
  43.          return this.parse(var2);
  44.       }
  45.    }
  46.  
  47.    public Document parse(File var1) throws SAXException, IOException {
  48.       if (var1 == null) {
  49.          throw new IllegalArgumentException("File cannot be null");
  50.       } else {
  51.          String var2 = FilePathToURI.filepath2URI(var1.getAbsolutePath());
  52.          InputSource var3 = new InputSource(var2);
  53.          return this.parse(var3);
  54.       }
  55.    }
  56.  
  57.    public abstract Document parse(InputSource var1) throws SAXException, IOException;
  58.  
  59.    public abstract boolean isNamespaceAware();
  60.  
  61.    public abstract boolean isValidating();
  62.  
  63.    public abstract void setEntityResolver(EntityResolver var1);
  64.  
  65.    public abstract void setErrorHandler(ErrorHandler var1);
  66.  
  67.    public abstract Document newDocument();
  68.  
  69.    public abstract DOMImplementation getDOMImplementation();
  70. }
  71.