Class RootPathMap

Object
org.anchoranalysis.plugin.io.input.path.RootPathMap

public class RootPathMap
extends Object
A collection of root-paths indexed by their name.

Currently exists as a singleton.

Author:
Owen Feehan
  • Method Summary

    Modifier and Type Method Description
    void addFromXmlFile​(Path path)
    Adds root-paths contained in a list of XML Beans in an xml file
    org.anchoranalysis.bean.shared.path.RootPath findRoot​(String name, boolean debug)
    Finds a root to match a name and debug/status
    static RootPathMap instance()  
    org.anchoranalysis.core.system.path.SplitPath split​(Path pathIn, String rootName, boolean debugMode)
    Given a path, it splits the *root* portion of the path from the remainder, trying a root identified by the rootName and debugMode (and if this fails, also trying with debugMode==false)

    Methods inherited from class java.lang.Object

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

    • split

      public org.anchoranalysis.core.system.path.SplitPath split​(Path pathIn, String rootName, boolean debugMode) throws org.anchoranalysis.core.system.path.PathDifferenceException
      Given a path, it splits the *root* portion of the path from the remainder, trying a root identified by the rootName and debugMode (and if this fails, also trying with debugMode==false)
      Parameters:
      pathIn - path to split
      rootName - identifier for a root to use
      debugMode - whether we are in debug mode or not
      Returns:
      the split-path
      Throws:
      org.anchoranalysis.core.system.path.PathDifferenceException - if the path cannot be matched against the root
    • instance

      public static RootPathMap instance()
    • addFromXmlFile

      public void addFromXmlFile​(Path path) throws org.anchoranalysis.core.exception.OperationFailedException
      Adds root-paths contained in a list of XML Beans in an xml file
      Parameters:
      path - the path to the XML file containing the root-paths
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException
    • findRoot

      public org.anchoranalysis.bean.shared.path.RootPath findRoot​(String name, boolean debug) throws org.anchoranalysis.core.system.path.PathDifferenceException
      Finds a root to match a name and debug/status
      Parameters:
      name - this name must match
      debug - if true, priority is given to root paths which also match debug.
      Returns:
      the found root, or an exception if one cannot be found
      Throws:
      org.anchoranalysis.core.system.path.PathDifferenceException