Beispiel #1
0
        /// <summary> Reads the atom types from the data file.
        ///
        /// </summary>
        /// <param name="builder">The IChemObjectBuilder used to create new IAtomType's.
        /// </param>
        /// <returns>         a Vector with atom types. Is empty if some reading error occured.
        /// </returns>
        public virtual System.Collections.ArrayList readAtomTypes(IChemObjectBuilder builder)
        {
            System.Collections.ArrayList isotopes = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
            try
            {
                parser.setFeature("http://xml.org/sax/features/validation", false);
                //logger.info("Deactivated validation");
            }
            //UPGRADE_TODO: Class 'org.xml.sax.SAXException' was converted to 'System.Xml.XmlException' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
            catch (System.Xml.XmlException exception)
            {
                //logger.warn("Cannot deactivate validation: ", exception.Message);
                //logger.debug(exception);
            }
            AtomTypeHandler handler = new AtomTypeHandler(builder);

            parser.setContentHandler(handler);
            try
            {
                parser.parse(new XmlSourceSupport(input));
                isotopes = handler.AtomTypes;
            }
            catch (System.IO.IOException exception)
            {
                //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
                //logger.error("IOException: ", exception.Message);
                //logger.debug(exception);
            }
            //UPGRADE_TODO: Class 'org.xml.sax.SAXException' was converted to 'System.Xml.XmlException' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
            catch (System.Xml.XmlException saxe)
            {
                //logger.error("SAXException: ", saxe.Message);
                //logger.debug(saxe);
            }
            return(isotopes);
        }
 /// <summary> Reads the atom types from the data file.
 /// 
 /// </summary>
 /// <param name="builder">The IChemObjectBuilder used to create new IAtomType's.
 /// </param>
 /// <returns>         a Vector with atom types. Is empty if some reading error occured.
 /// </returns>
 public virtual System.Collections.ArrayList readAtomTypes(IChemObjectBuilder builder)
 {
     System.Collections.ArrayList isotopes = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
     try
     {
         parser.setFeature("http://xml.org/sax/features/validation", false);
         //logger.info("Deactivated validation");
     }
     //UPGRADE_TODO: Class 'org.xml.sax.SAXException' was converted to 'System.Xml.XmlException' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
     catch (System.Xml.XmlException exception)
     {
         //logger.warn("Cannot deactivate validation: ", exception.Message);
         //logger.debug(exception);
     }
     AtomTypeHandler handler = new AtomTypeHandler(builder);
     parser.setContentHandler(handler);
     try
     {
         parser.parse(new XmlSourceSupport(input));
         isotopes = handler.AtomTypes;
     }
     catch (System.IO.IOException exception)
     {
         //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
         //logger.error("IOException: ", exception.Message);
         //logger.debug(exception);
     }
     //UPGRADE_TODO: Class 'org.xml.sax.SAXException' was converted to 'System.Xml.XmlException' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
     catch (System.Xml.XmlException saxe)
     {
         //logger.error("SAXException: ", saxe.Message);
         //logger.debug(saxe);
     }
     return isotopes;
 }