Class BlastXMLParserFacade

  • All Implemented Interfaces:
    org.xml.sax.XMLReader

    public class BlastXMLParserFacade
    extends java.lang.Object
    implements org.xml.sax.XMLReader
    A facade class that wraps the NCBI Blast XML parsing framework in a more user-friendly form. It is identical to BlastlikeSAXParser in use.
    Since:
    1.3
    Author:
    David Huen
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.xml.sax.ContentHandler getContentHandler()
      correct this later
      org.xml.sax.DTDHandler getDTDHandler()  
      org.xml.sax.EntityResolver getEntityResolver()
      This class has an EntityResolver that resolves the public ID specifying the NCBI DTDs to resource files within the BioJava libraries.
      org.xml.sax.ErrorHandler getErrorHandler()  
      boolean getFeature​(java.lang.String name)  
      java.lang.Object getProperty​(java.lang.String name)  
      void parse​(java.lang.String systemId)  
      void parse​(org.xml.sax.InputSource is)  
      void setContentHandler​(org.xml.sax.ContentHandler handler)
      this sets the ContentHandler that receives SAX events from the internal Blast XML parser which is the actual ContentHandler.
      void setDTDHandler​(org.xml.sax.DTDHandler handler)  
      void setEntityResolver​(org.xml.sax.EntityResolver resolver)
      This class has an EntityResolver that resolves the public ID specifying the NCBI DTDs to resource files within the BioJava libraries.
      void setErrorHandler​(org.xml.sax.ErrorHandler handler)  
      void setFeature​(java.lang.String key, boolean value)
      by default, we set the parser to non-validating.
      void setProperty​(java.lang.String key, java.lang.Object value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getContentHandler

        public org.xml.sax.ContentHandler getContentHandler()
        correct this later
        Specified by:
        getContentHandler in interface org.xml.sax.XMLReader
      • getDTDHandler

        public org.xml.sax.DTDHandler getDTDHandler()
        Specified by:
        getDTDHandler in interface org.xml.sax.XMLReader
      • getEntityResolver

        public org.xml.sax.EntityResolver getEntityResolver()
        This class has an EntityResolver that resolves the public ID specifying the NCBI DTDs to resource files within the BioJava libraries. This call will return that resolver. It you should set your own resolver, ensure you resolve that URN yourself or the parser will blow up on you!.
        Specified by:
        getEntityResolver in interface org.xml.sax.XMLReader
      • getErrorHandler

        public org.xml.sax.ErrorHandler getErrorHandler()
        Specified by:
        getErrorHandler in interface org.xml.sax.XMLReader
      • getFeature

        public boolean getFeature​(java.lang.String name)
                           throws org.xml.sax.SAXNotRecognizedException,
                                  org.xml.sax.SAXNotSupportedException
        Specified by:
        getFeature in interface org.xml.sax.XMLReader
        Throws:
        org.xml.sax.SAXNotRecognizedException
        org.xml.sax.SAXNotSupportedException
      • getProperty

        public java.lang.Object getProperty​(java.lang.String name)
                                     throws org.xml.sax.SAXNotRecognizedException,
                                            org.xml.sax.SAXNotSupportedException
        Specified by:
        getProperty in interface org.xml.sax.XMLReader
        Throws:
        org.xml.sax.SAXNotRecognizedException
        org.xml.sax.SAXNotSupportedException
      • parse

        public void parse​(org.xml.sax.InputSource is)
                   throws java.io.IOException,
                          org.xml.sax.SAXException
        Specified by:
        parse in interface org.xml.sax.XMLReader
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • parse

        public void parse​(java.lang.String systemId)
                   throws java.io.IOException,
                          org.xml.sax.SAXException
        Specified by:
        parse in interface org.xml.sax.XMLReader
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • setContentHandler

        public void setContentHandler​(org.xml.sax.ContentHandler handler)
        this sets the ContentHandler that receives SAX events from the internal Blast XML parser which is the actual ContentHandler. It will not change the internal Blast XML parser.
        Specified by:
        setContentHandler in interface org.xml.sax.XMLReader
      • setDTDHandler

        public void setDTDHandler​(org.xml.sax.DTDHandler handler)
        Specified by:
        setDTDHandler in interface org.xml.sax.XMLReader
      • setEntityResolver

        public void setEntityResolver​(org.xml.sax.EntityResolver resolver)
        This class has an EntityResolver that resolves the public ID specifying the NCBI DTDs to resource files within the BioJava libraries. This call will return that resolver. It you should set your own resolver, ensure you resolve that URN yourself or the parser will blow up on you!.
        Specified by:
        setEntityResolver in interface org.xml.sax.XMLReader
      • setErrorHandler

        public void setErrorHandler​(org.xml.sax.ErrorHandler handler)
        Specified by:
        setErrorHandler in interface org.xml.sax.XMLReader
      • setFeature

        public void setFeature​(java.lang.String key,
                               boolean value)
                        throws org.xml.sax.SAXNotRecognizedException,
                               org.xml.sax.SAXNotSupportedException
        by default, we set the parser to non-validating. change it if you wish/dare! The parser is also set to be namespace aware. DO NOT CHANGE THAT!!!
        Specified by:
        setFeature in interface org.xml.sax.XMLReader
        Throws:
        org.xml.sax.SAXNotRecognizedException
        org.xml.sax.SAXNotSupportedException
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.Object value)
                         throws org.xml.sax.SAXNotRecognizedException,
                                org.xml.sax.SAXNotSupportedException
        Specified by:
        setProperty in interface org.xml.sax.XMLReader
        Throws:
        org.xml.sax.SAXNotRecognizedException
        org.xml.sax.SAXNotSupportedException