Class CMLReader

    • Constructor Detail

      • CMLReader

        public CMLReader​(InputStream input)
        Reads CML from an java.io.InputStream, for example the FileInputStream.
        Parameters:
        input - InputStream type input
      • CMLReader

        public CMLReader()
      • CMLReader

        public CMLReader​(String url)
        Define this CMLReader to take the input from a java.io.Reader class. Possible readers are (among others) StringReader and FileReader.
        Parameters:
        url - String url which points to the file to be read
    • Method Detail

      • registerConvention

        public void registerConvention​(String convention,
                                       ICMLModule conv)
      • setReader

        public void setReader​(Reader reader)
                       throws CDKException
        This method must not be used; XML reading requires the use of an InputStream. Use setReader(InputStream) instead.
        Throws:
        CDKException
      • accepts

        public boolean accepts​(Class<? extends IChemObject> classObject)
        Description copied from interface: IChemObjectIO
        Returns whether the given IChemObject can be read or written.
        Parameters:
        classObject - IChemObject of which is tested if it can be handled.
        Returns:
        true, if the IChemObject can be handled.
      • read

        public <T extends IChemObject> T read​(T object)
                                       throws CDKException
        Read a IChemObject from input.
        Parameters:
        object - the type of object to return
        Returns:
        the content in a ChemFile object
        Throws:
        CDKException - it is thrown if the type of information is not available from the input
      • close

        public void close()
                   throws IOException
        Description copied from interface: IChemObjectIO
        Closes this IChemObjectIO's resources.
        Throws:
        IOException - when the wrapper IO class cannot be closed.