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 voidaddFromXmlFile(Path path)Adds root-paths contained in a list of XML Beans in an xml fileorg.anchoranalysis.bean.shared.path.RootPathfindRoot(String name, boolean debug)Finds a root to match a name and debug/statusstatic RootPathMapinstance()org.anchoranalysis.core.system.path.SplitPathsplit(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)
-
Method Details
-
split
public org.anchoranalysis.core.system.path.SplitPath split(Path pathIn, String rootName, boolean debugMode) throws org.anchoranalysis.core.system.path.PathDifferenceExceptionGiven 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 splitrootName- identifier for a root to usedebugMode- 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
-
addFromXmlFile
public void addFromXmlFile(Path path) throws org.anchoranalysis.core.exception.OperationFailedExceptionAdds 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.PathDifferenceExceptionFinds a root to match a name and debug/status- Parameters:
name- this name must matchdebug- 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
-