Class LipidParser

java.lang.Object
org.lifstools.jgoslin.parser.LipidParser

public class LipidParser extends Object
Implementation that uses all available parsers to parse a given lipid name. First successful parser implementation wins.
Author:
Dominik Kopczynski, Nils Hoffmann
  • Constructor Details

    • LipidParser

      public LipidParser()
      Create a new lipid parser instance.
    • LipidParser

      public LipidParser(KnownFunctionalGroups knownFunctionalGroups)
      Create a new lipid parser instance.
      Parameters:
      knownFunctionalGroups - the known functional groups
  • Method Details

    • parse

      public LipidAdduct parse(String lipidName)
      This method tries multiple parsers in a defined order to parse the provided lipid name.If no parser is able to parse the name successfully, an exception is thrown.
      Parameters:
      lipidName - the lipid name to parse.
      Returns:
      the LipidAdduct if parsing with at least one parser succeeded.
      Throws:
      LipidParsingException - if now parser was able to parse the provided lipid name.
    • getLastSuccessfulParser

      Returns the last successful parser instance. May be null, if either no parser has been applied yet, or no parser has been successfully applied for parsing the last lipid name.
      Returns:
      the last successful parser instance.
    • getLastSuccessfulGrammar

      Returns the grammar name of the last successful parser.
      Returns:
      the grammar name of the last successful parser.