Logo Search packages:      
Sourcecode: cdk version File versions  Download package

Map<String,String> org::openscience::cdk::config::atomtypes::OWLAtomTypeMappingReader::readAtomTypeMappings (  ) [inline]

Reads the atom type mappings from the data file.

Returns:
a Map with atom type mappings. Null, if some reading error occurred.

Definition at line 105 of file OWLAtomTypeMappingReader.java.

References org::openscience::cdk::config::atomtypes::OWLAtomTypeMappingHandler::getAtomTypeMappings().

                                                     {
      Map<String,String> mappings = null;
        try {
            parser.setFeature("http://xml.org/sax/features/validation", false);
            logger.info("Deactivated validation");
        } catch (SAXException exception) {
            logger.warn("Cannot deactivate validation: ", exception.getMessage());
            logger.debug(exception);
        }
        OWLAtomTypeMappingHandler handler = new OWLAtomTypeMappingHandler();
        parser.setContentHandler(handler);
        try {
            parser.parse(new InputSource(input));
            mappings = handler.getAtomTypeMappings();
        } catch (IOException exception) {
            logger.error("IOException: ",exception.getMessage());
            logger.debug(exception);
        } catch (SAXException saxe) {
            logger.error("SAXException: ", saxe.getMessage());
            logger.debug(saxe);
        }
        return mappings == null ? new HashMap<String,String>() : mappings;
    }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index