Package de.firemage.autograder.core.file
Interface SourceInfo
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FileSourceInfo,StringSourceInfo
This interface represents the source code folder of a submission.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the compilation units of the source.Copies the source to the given target directory.default CompilationUnitgetCompilationUnit(SourcePath path) default CompilationUnitgetCompilationUnit(URI uri) default CompilationUnitgetCompilationUnit(Path path) default StringgetName()A name representing the source.spoon.compiler.SpoonResourceReturns the java version required to compile the source.path()Returns a path to the source, which might not exist on the file-system.
-
Method Details
-
compilationUnits
Returns the compilation units of the source.All compilation units must be relative to the root of the source returned by
path().- Returns:
- the compilation units of the source or an empty list if there are none
- Throws:
IOException- if the compilation units could not be read
-
copyTo
Copies the source to the given target directory.- Parameters:
target- the target directory, which must be accessible- Returns:
- a new
SourceInforepresenting the copied source - Throws:
IOException- if the copy failed
-
getSpoonResource
spoon.compiler.SpoonResource getSpoonResource() -
getName
A name representing the source. This must not represent the real name of the source file or a path.- Returns:
- the name of the source, which must not be unique
-
getCompilationUnit
-
getCompilationUnit
-
getCompilationUnit
-
path
Path path()Returns a path to the source, which might not exist on the file-system.For example, one could have the entire code in memory, so there would be no path on the file-system.
- Returns:
- a path to the source
-
getVersion
JavaVersion getVersion()Returns the java version required to compile the source.- Returns:
- the java version required to compile the source
-