public class VoidCompiler extends Object implements HotCompiler
The purpose of a VoidCompiler is to reload the application if some files are changed
(but requiring no recompilation). For example, if the application reads ".properties"
files
on startup and cache the information in memory, it needs to be reloaded if some of the files are changed.
See also
HotReloader.onFiles(fileDesc, filePattern, srcDirs)
.
Constructor and Description |
---|
VoidCompiler(String fileDesc,
PathMatcher pathMatcher)
Create a VoidCompiler.
|
Instance Methods | |
---|---|
PathMatcher |
getPathMatcher()
The PathMatcher for source files.
|
void |
compile(Consumer<CharSequence> msgOut,
Set<Path> allFiles)
Does nothing, except printing some messages to
msgOut . |
void |
compile(Consumer<CharSequence> msgOut,
Set<Path> createdFiles,
Set<Path> updatedFiles,
Set<Path> deletedFiles)
Does nothing, except printing some messages to
msgOut . |
public VoidCompiler(String fileDesc, PathMatcher pathMatcher)
fileDesc
is used for diagnosis outputs.
For example:
new VoidCompiler("java", FileSystems.getDefault().getPathMatcher("glob:**.java"))
public PathMatcher getPathMatcher()
HotCompiler
Only those files under the srcDirs
will be fed to this PathMatcher;
only those approved by this PathMatcher are source files for this compiler.
An example PathMatcher:
FileSystems.getDefault().getPathMatcher("glob:**.java")
.
getPathMatcher
in interface HotCompiler
FileSystem.getPathMatcher(String)
public void compile(Consumer<CharSequence> msgOut, Set<Path> allFiles)
msgOut
.compile
in interface HotCompiler
msgOut
- for diagnosis messages; see HotReloader.getMessageOut()
public void compile(Consumer<CharSequence> msgOut, Set<Path> createdFiles, Set<Path> updatedFiles, Set<Path> deletedFiles)
msgOut
.compile
in interface HotCompiler
msgOut
- for diagnosis messages; see HotReloader.getMessageOut()