Class MDLV3000Converter

java.lang.Object
de.ipb_halle.molecularfaces.converter.MDLV3000Converter
All Implemented Interfaces:
jakarta.faces.convert.Converter

public class MDLV3000Converter extends Object implements jakarta.faces.convert.Converter
This FacesConverter converts MDL Molfile V3000 strings to CDK's IAtomContainer objects and vice versa.
  • Field Summary

    Fields inherited from interface jakarta.faces.convert.Converter

    DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.openscience.cdk.interfaces.IAtomContainer
    getAsObject(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, String value)
    Converts a MDL Molfile V3000 string to an IAtomContainer.
    getAsString(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, Object value)
    Converts an IAtomContainer to a MDL Molfile V3000 string.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MDLV3000Converter

      public MDLV3000Converter()
  • Method Details

    • getAsObject

      public org.openscience.cdk.interfaces.IAtomContainer getAsObject(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, String value) throws jakarta.faces.convert.ConverterException
      Converts a MDL Molfile V3000 string to an IAtomContainer.
      Specified by:
      getAsObject in interface jakarta.faces.convert.Converter
      Returns:
      valid IAtomContainer object or null if value is null or empty.
      Throws:
      jakarta.faces.convert.ConverterException - if reading of the Molfile fails
    • getAsString

      public String getAsString(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, Object value) throws jakarta.faces.convert.ConverterException
      Converts an IAtomContainer to a MDL Molfile V3000 string.
      Specified by:
      getAsString in interface jakarta.faces.convert.Converter
      Returns:
      valid MDL Molfile V3000 or empty string if value is null or not an IAtomContainer
      Throws:
      jakarta.faces.convert.ConverterException - if writing of the Molfile fails