Class AutoImporter
Program imports automatically (without requiring user interaction)-
Method Summary
Modifier and TypeMethodDescriptionimportAsBinary(ByteProvider bytes, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) Automatically imports the givenByteProviderbytes with theBinaryLoader, using the given language and compiler specification.importAsBinary(File file, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) Automatically imports the givenFilewith theBinaryLoader, using the given language and compiler specification.static LoadResults<Program> importByLookingForLcs(FSRL fsrl, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults<Program> importByLookingForLcs(File file, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults<Program> importByUsingBestGuess(ByteProvider provider, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults<Program> importByUsingBestGuess(FSRL fsrl, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults<Program> importByUsingBestGuess(File file, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults<Program> importByUsingSpecificLoaderClass(FSRL fsrl, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults<Program> importByUsingSpecificLoaderClass(File file, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults<Program> importByUsingSpecificLoaderClassAndLcs(FSRL fsrl, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults<Program> importByUsingSpecificLoaderClassAndLcs(File file, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) static LoadResults<Program> importFresh(ByteProvider provider, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) Automatically imports the givenbyteswith advanced options.static LoadResults<Program> importFresh(FSRL fsrl, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) Automatically imports the givenFSRLwith advanced options.static LoadResults<Program> importFresh(File file, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) Automatically imports the givenFilewith advanced options.
-
Method Details
-
importByUsingBestGuess
public static LoadResults<Program> importByUsingBestGuess(File file, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFilewith the best matchingLoaderfor theFile's format.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
file- TheFileto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().consumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importByUsingBestGuess
public static LoadResults<Program> importByUsingBestGuess(FSRL fsrl, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFSRLwith the best matchingLoaderfor theFile's format.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
fsrl- TheFSRLto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().consumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importByUsingBestGuess
public static LoadResults<Program> importByUsingBestGuess(ByteProvider provider, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givebyteswith the best matchingLoaderfor theByteProvider's format.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
provider- The bytes to importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().consumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importByUsingSpecificLoaderClass
public static LoadResults<Program> importByUsingSpecificLoaderClass(File file, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadExceptionAutomatically imports the givenFilewith the given type ofLoader.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
file- TheFileto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().loaderClass- TheLoaderclass to useloaderArgs- AListof optionalLoader-specific argumentsconsumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importByUsingSpecificLoaderClass
public static LoadResults<Program> importByUsingSpecificLoaderClass(FSRL fsrl, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadExceptionAutomatically imports the givenFSRLwith the given type ofLoader.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
fsrl- TheFSRLto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().loaderClass- TheLoaderclass to useloaderArgs- AListof optionalLoader-specific argumentsconsumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importByLookingForLcs
public static LoadResults<Program> importByLookingForLcs(File file, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFilewith the best matchingLoaderthat supports the given language and compiler specification.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
file- TheFileto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().language- The desiredLanguagecompilerSpec- The desiredcompiler specificationconsumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importByLookingForLcs
public static LoadResults<Program> importByLookingForLcs(FSRL fsrl, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFSRLwith the best matchingLoaderthat supports the given language and compiler specification.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
fsrl- TheFSRLto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().language- The desiredLanguagecompilerSpec- The desiredcompiler specificationconsumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importByUsingSpecificLoaderClassAndLcs
public static LoadResults<Program> importByUsingSpecificLoaderClassAndLcs(File file, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionExceptionAutomatically imports the givenFilewith the given type ofLoader, language, and compiler specification.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
file- TheFileto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().loaderClass- TheLoaderclass to useloaderArgs- AListof optionalLoader-specific argumentslanguage- The desiredLanguagecompilerSpec- The desiredcompiler specificationconsumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgrade
-
importByUsingSpecificLoaderClassAndLcs
public static LoadResults<Program> importByUsingSpecificLoaderClassAndLcs(FSRL fsrl, Project project, String projectFolderPath, Class<? extends Loader> loaderClass, List<Pair<String, String>> loaderArgs, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionExceptionAutomatically imports the givenFSRLwith the given type ofLoader, language, and compiler specification.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
fsrl- TheFSRLto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().loaderClass- TheLoaderclass to useloaderArgs- AListof optionalLoader-specific argumentslanguage- The desiredLanguagecompilerSpec- The desiredcompiler specificationconsumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgrade
-
importAsBinary
public static Loaded<Program> importAsBinary(File file, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFilewith theBinaryLoader, using the given language and compiler specification.Note that when the import completes, the returned
LoadedProgramis not saved to a project. That is the responsibility of the caller (seeLoaded.save(Project, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedProgramwithLoaded.release(Object)when it is no longer needed.- Parameters:
file- TheFileto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedProgram. This is just a suggestion, and aLoaderimplementation reserves the right to change it for theLoadedresult. TheLoadedresult should be queried for its true project folder paths usingLoaded.getProjectFolderPath().language- The desiredLanguagecompilerSpec- The desiredcompiler specificationconsumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadedProgram(created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importAsBinary
public static Loaded<Program> importAsBinary(ByteProvider bytes, Project project, String projectFolderPath, Language language, CompilerSpec compilerSpec, Object consumer, MessageLog messageLog, TaskMonitor monitor) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenByteProviderbytes with theBinaryLoader, using the given language and compiler specification.Note that when the import completes, the returned
LoadedProgramis not saved to a project. That is the responsibility of the caller (seeLoaded.save(Project, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedProgramwithLoaded.release(Object)when it is no longer needed.- Parameters:
bytes- The bytes to importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedProgram. This is just a suggestion, and aLoaderimplementation reserves the right to change it theLoadedresult. TheLoadedresult should be queried for its true project folder paths usingLoaded.getProjectFolderPath().language- The desiredLanguagecompilerSpec- The desiredcompiler specificationconsumer- A consumermessageLog- The logmonitor- A task monitor- Returns:
- The
LoadedProgram(created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importFresh
public static LoadResults<Program> importFresh(File file, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFilewith advanced options.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
file- TheFileto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().consumer- A consumermessageLog- The logmonitor- A task monitorloaderFilter- APredicateused to choose whatLoader(s) get usedloadSpecChooser- ALoadSpecChooserused to choose whatLoadSpec(s) get usedimportNameOverride- The name to use for the imported thing. Null to use theLoader's preferred name.optionChooser- AOptionChooserused to choose whatLoaderoptions get used- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importFresh
public static LoadResults<Program> importFresh(FSRL fsrl, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenFSRLwith advanced options.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
fsrl- TheFSRLto importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().consumer- A consumermessageLog- The logmonitor- A task monitorloaderFilter- APredicateused to choose whatLoader(s) get usedloadSpecChooser- ALoadSpecChooserused to choose whatLoadSpec(s) get usedimportNameOverride- The name to use for the imported thing. Null to use theLoader's preferred name.optionChooser- AOptionChooserused to choose whatLoaderoptions get used- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-
importFresh
public static LoadResults<Program> importFresh(ByteProvider provider, Project project, String projectFolderPath, Object consumer, MessageLog messageLog, TaskMonitor monitor, Predicate<Loader> loaderFilter, LoadSpecChooser loadSpecChooser, String importNameOverride, OptionChooser optionChooser) throws IOException, CancelledException, DuplicateNameException, InvalidNameException, VersionException, LoadException Automatically imports the givenbyteswith advanced options.Note that when the import completes, the returned
LoadedPrograms are not saved to a project. That is the responsibility of the caller (seeLoadResults.save(Project, Object, MessageLog, TaskMonitor)).It is also the responsibility of the caller to release the returned
LoadedPrograms withLoadResults.release(Object)when they are no longer needed.- Parameters:
provider- The bytes to importproject- TheProject. Loaders can use this to take advantage of existingDomainFolders andDomainFiles to do custom behaviors such as loading libraries. Could be null if there is no project.projectFolderPath- A suggested project folder path for theLoadedPrograms. This is just a suggestion, and aLoaderimplementation reserves the right to change it for eachLoadedresult. TheLoadedresults should be queried for their true project folder paths usingLoaded.getProjectFolderPath().consumer- A consumermessageLog- The logmonitor- A task monitorloaderFilter- APredicateused to choose whatLoader(s) get usedloadSpecChooser- ALoadSpecChooserused to choose whatLoadSpec(s) get usedimportNameOverride- The name to use for the imported thing. Null to use theLoader's preferred name.optionChooser- AOptionChooserused to choose whatLoaderoptions get used- Returns:
- The
LoadResultswhich contains one ore moreLoadedPrograms (created but not saved) - Throws:
IOException- if there was an IO-related problem loadingCancelledException- if the operation was cancelledDuplicateNameException- if the load resulted in aProgramnaming conflictInvalidNameException- if an invalidProgramname was used during loadVersionException- if there was an issue with database versions, probably due to a failed language upgradeLoadException- if nothing was loaded
-