Package de.monticore.io.paths
Class MCPath
java.lang.Object
de.monticore.io.paths.MCPath
A ModelPath encapsulates the domain of accessible models inside the running
language tool.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classKey for the find(Str,Str) cache With an equals and hashCode implementation -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()static voidCloses all still opened file systems created withgetJarFS(File).do_findResolvedUrls(String fixedPath) Searches for a path in all entries.Method for calculating a list of files located in an entry of the passed model path, with the passed qualified model name, and the passed regular expression over the file extension.findResolvedUrls(String fixedPath) static FileSystembooleanisEmpty()voidremoveEntry(Path entry) protected static voidreportAmbiguity(List<URL> resolvedURLs, String path) toString()
-
Field Details
-
classloaderMap
-
-
Constructor Details
-
MCPath
public MCPath() -
MCPath
-
MCPath
-
MCPath
-
-
Method Details
-
addEntry
-
removeEntry
-
getEntries
-
isEmpty
public boolean isEmpty() -
find
Method for calculating a list of files located in an entry of the passed model path, with the passed qualified model name, and the passed regular expression over the file extension.Example: for a model path comprising two entries "src/test/resources" and "target", the qualified model name "foo.bar.Car", and the file extension regular expression "*sym", the result of this method could be a list with three files: "src/test/resources/foo/bar/Car.fdsym" "src/test/resources/foo/bar/Car.cdsym" "target/foo/bar/Car.fdsym"
- Parameters:
fileExtRegEx-- Returns:
-
find
Searches for a path in all entries. The result is either the fully qualified path or an empty Optional. An error is logged if multiple, ambiguous results are found.- Parameters:
path- a relative path, e.g, a/b/C.foo, to search in all MCPath entries- Returns:
- the URL representing the unique fully qualified name of the result, if it exists
- Throws:
AmbiguityException- if the search locates multiple potentially matching models
-
findResolvedUrls
-
do_findResolvedUrls
-
toString
-
toPath
-
toURL
-
reportAmbiguity
-
close
public void close() -
getJarFS
-
closeAllJarFileSystems
public static void closeAllJarFileSystems()Closes all still opened file systems created withgetJarFS(File).
-