Documentation of 'org.spaceroots.rkcheck.XMLFile' Java class
XMLFile
org.spaceroots.rkcheck

Class XMLFile

  • All Implemented Interfaces:
    org.xml.sax.ErrorHandler
    Direct Known Subclasses:
    RungeKuttaFile


    public abstract class XMLFile
    extends java.lang.Object
    implements org.xml.sax.ErrorHandler
    This class is the base class for application-specific XML files reading/writing.

    In order to read/write application-specific XML files, a concrete class extending this abstract base class must be created and the four analyze, build, getPublicId and getSystemId methods must be implemented.

    • Constructor Summary

      Constructors 
      Constructor and Description
      XMLFile()
      Simple constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      abstract void analyze(org.w3c.dom.Document document, java.lang.String uri)
      Analyze the DOM tree.
      abstract void build(org.w3c.dom.Document document, java.lang.String uri)
      Build the DOM tree.
      void error(org.xml.sax.SAXParseException exception)
      Receive notification of a recoverable error.
      void fatalError(org.xml.sax.SAXParseException exception)
      Receive notification of a non-recoverable error.
      void read(java.lang.String uri)
      Parse an XML document containing an application-specific configuration.
      void warning(org.xml.sax.SAXParseException exception)
      Receive notification of a warning.
      void write(java.io.Writer writer, java.lang.String uri)
      Write an XML document.
      • Methods inherited from class java.lang.Object

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

      • read

        public void read(java.lang.String uri)
                  throws RKCheckException,
                         java.io.IOException,
                         java.io.FileNotFoundException
        Parse an XML document containing an application-specific configuration.
        Parameters:
        uri - URI of the project document to read
        Throws:
        RKCheckException - if an error occurs during parsing (mainly because there is an error in the document)
        java.io.IOException - if there is low level read error
        java.io.FileNotFoundException - if there is low level file error
      • write

        public void write(java.io.Writer writer,
                          java.lang.String uri)
                   throws RKCheckException,
                          java.io.IOException
        Write an XML document.
        Parameters:
        writer - writer to use for producing the document
        uri - URI of the document
        Throws:
        RKCheckException - if an error occurs during write
        java.io.IOException - if there is low level read error
      • error

        public void error(org.xml.sax.SAXParseException exception)
                   throws org.xml.sax.SAXParseException
        Receive notification of a recoverable error.
        Specified by:
        error in interface org.xml.sax.ErrorHandler
        Parameters:
        exception - the recoverable error
        Throws:
        org.xml.sax.SAXException - the error is directly thrown as an exception
        org.xml.sax.SAXParseException
      • fatalError

        public void fatalError(org.xml.sax.SAXParseException exception)
                        throws org.xml.sax.SAXParseException
        Receive notification of a non-recoverable error.
        Specified by:
        fatalError in interface org.xml.sax.ErrorHandler
        Parameters:
        exception - the non-recoverable error
        Throws:
        org.xml.sax.SAXException - the error is directly thrown as an exception
        org.xml.sax.SAXParseException
      • warning

        public void warning(org.xml.sax.SAXParseException exception)
                     throws org.xml.sax.SAXParseException
        Receive notification of a warning.
        Specified by:
        warning in interface org.xml.sax.ErrorHandler
        Parameters:
        exception - the warning
        Throws:
        org.xml.sax.SAXException - the error is directly thrown as an exception
        org.xml.sax.SAXParseException
      • analyze

        public abstract void analyze(org.w3c.dom.Document document,
                                     java.lang.String uri)
                              throws RKCheckException,
                                     java.lang.NumberFormatException
        Analyze the DOM tree.

        This method is called by the read method after having build the DOM tree. Its purpose is to analyze the tree and store the contained information in application-specific ways.

        Parameters:
        document - DOM tree to analyze
        uri - URI from which the project document was read (useful mainly for error messages)
        Throws:
        RKCheckException - if some data cannot be found in the tree
        java.lang.NumberFormatException - if some number cannot be parsed
      • build

        public abstract void build(org.w3c.dom.Document document,
                                   java.lang.String uri)
                            throws RKCheckException
        Build the DOM tree.

        This method is called by the write method before writing the DOM tree. Its purpose is to build the DOM tree in application-specific ways.

        Parameters:
        document - empty DOM tree to build
        uri - URI where the project document will be written (useful mainly for error messages)
        Throws:
        RKCheckException - if some problem occurs while building the tree

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.