Class MDLV3000Writer

All Implemented Interfaces:
Closeable, AutoCloseable, IChemObjectIO, IChemObjectWriter

public final class MDLV3000Writer extends DefaultChemObjectWriter
Ctab V3000 format output. This writer provides output to the more modern (but less widely supported) V3000 format. Unlikely the V2000 format that is limited to 999 atoms or bonds V3000 can write arbitrarily large molecules. Beyond this the format removes some (but not all) ambiguities and simplifies output values with tagging (e.g 'CHG=-1' instead of '5'). Supported Features:
  • Atom Block, non-query features
  • Bond Block, non-query features
  • Sgroup Block, partial support for all chemical Sgroups, complete support for: Abbreviations, MultipleGroup, SRUs, (Un)ordered Mixtures
The 3D block and enhanced stereochemistry is not currently supported.
  • Constructor Details

    • MDLV3000Writer

      public MDLV3000Writer(Writer writer)
      Create a new V3000 writer, output to the provided JDK writer.
      Parameters:
      writer - output location
    • MDLV3000Writer

      public MDLV3000Writer(OutputStream out) throws CDKException
      Create a new V3000 writer, output to the provided JDK output stream.
      Parameters:
      out - output location
      Throws:
      CDKException
    • MDLV3000Writer

      public MDLV3000Writer()
      Default empty constructor.
  • Method Details

    • write

      public void write(IChemObject object) throws CDKException
      Writes a molecule to the V3000 format. Writes the content of "object" to output.
      Parameters:
      object - the object of which the content is outputted
      Throws:
      CDKException - state exception (e.g undef bonds), unsupported format feature, object not supported etc
    • setWriter

      public void setWriter(Writer writer) throws CDKException
      Sets the Writer from which this ChemObjectWriter should write the contents.
      Throws:
      CDKException
    • setWriter

      public void setWriter(OutputStream writer) throws CDKException
      Sets the OutputStream from which this ChemObjectWriter should write the contents.
      Throws:
      CDKException
    • getFormat

      public IResourceFormat getFormat()
      Returns the IResourceFormat class for this IO class.
    • accepts

      public boolean accepts(Class<? extends IChemObject> c)
      Returns whether the given IChemObject can be read or written.
      Parameters:
      c - IChemObject of which is tested if it can be handled.
      Returns:
      true, if the IChemObject can be handled.
    • close

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

      public void customizeJob()