Class ConfigReader

  • All Implemented Interfaces:
    XMLConfigConstants

    public class ConfigReader
    extends java.lang.Object
    implements XMLConfigConstants

    Used internally by the JCSP network infrastructure to load a configuration from an XML file.

    This is not a full XML reader, and is capable of reading only a subset of XML.

    • Field Detail

      • config

        private JCSPConfig config
        The config built up.
      • servicePos

        private int servicePos
      • protocolPos

        private int protocolPos
      • attribs

        private final java.lang.String[] attribs
      • values

        private final java.lang.String[] values
    • Constructor Detail

      • ConfigReader

        public ConfigReader​(java.io.InputStream instream)
                     throws java.io.IOException
        Constructs a new configuration from the given source stream. This will attempt to parse the file using recursive-descent approach.
        Parameters:
        instream - source of the XML configuration.
        Throws:
        java.io.IOException - if there is a problem with the stream or the file is improperly formatted.
        ConfigReader.XMLValidationException - if there is a symantic problem with the configuration.
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Diagnostic routine. This can load an XML configuration file and then display the configuration structure constructed. Specify the name of the file as the first command line parameter.
      • do_template

        private void do_template​(java.io.Reader in)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • doJCSP_Config

        private void doJCSP_Config​(java.io.Reader in)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • doSettings

        private void doSettings​(java.io.Reader in)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • doServices

        private void doServices​(java.io.Reader in)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • doService

        private void doService​(java.io.Reader in)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • doPlugins

        private void doPlugins​(java.io.Reader in)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • doPlugin

        private void doPlugin​(java.io.Reader in)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • doProtocols

        private void doProtocols​(java.io.Reader in)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • doProtocol

        private void doProtocol​(java.io.Reader in)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • doProtocolSpecs

        private void doProtocolSpecs​(java.io.Reader in)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • doProtocolSettings

        private void doProtocolSettings​(java.io.Reader in)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • doAddresses

        private void doAddresses​(java.io.Reader in)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • doAddress

        private void doAddress​(java.io.Reader in)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • doAddressSpecs

        private void doAddressSpecs​(java.io.Reader in)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • doNodeSpecs

        private void doNodeSpecs​(java.io.Reader in)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • doLinkProfiles

        private void doLinkProfiles​(java.io.Reader in)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • doLinkProfile

        private void doLinkProfile​(java.io.Reader in)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • doLinkReqs

        private void doLinkReqs​(java.io.Reader in)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • doNodeProfiles

        private void doNodeProfiles​(java.io.Reader in)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • doNodeProfile

        private void doNodeProfile​(java.io.Reader in)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • doNodeReqs

        private void doNodeReqs​(java.io.Reader in)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • nextTag

        private ConfigReader.Tag nextTag​(java.io.Reader in)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • isSpace

        private boolean isSpace​(char c)
      • nextChar

        private char nextChar​(java.io.Reader in)
                       throws java.io.IOException
        Throws:
        java.io.IOException