public class FileUpdateManager extends Object
This mechanism is useful when you include dark-matter code generation as part of your build process because it cuts down on the number of files that have to be recompiled; if code hasn't changed, the FileUpdateManager leaves the original file (and its time stamp) intact, so unneeded recompilation is avoided.
| Modifier | Constructor and Description |
|---|---|
protected |
FileUpdateManager()
Constructs a new FileUpdateManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteFiles(boolean f)
Delete files for obsolete files defaults to true.
|
void |
fileClosed(ManagedFileWriter mfw)
This method is called from the ManagedFileWriter when its close() method is called.
|
void |
fileHeader(String fh)
Sets the file header that will be automatically written to your files.
|
void |
generationComplete()
This method should be called when a code generation cycle is complete.
|
void |
generationStarting()
You should call this method when you are about to start a code generation cycle.
|
ManagedFileWriter |
getWriter(String of,
String fn)
Use this method to get a BufferedWriter for the file you're generating and close it
as normal when you're done.
|
static FileUpdateManager |
instance() |
void |
reportErrors(PrintStream ps)
Sets the stream to which error messages will be dumped.
|
void |
reportProgress(PrintStream ps)
Sets the stream to which progress messages will be dumped.
|
protected FileUpdateManager()
public static FileUpdateManager instance()
public void deleteFiles(boolean f)
f - public void reportProgress(PrintStream ps)
ps - The print stream.public void reportErrors(PrintStream ps)
ps - The print stream.public void fileHeader(String fh)
fh - public void generationStarting()
public void generationComplete()
public ManagedFileWriter getWriter(String of, String fn) throws IOException
of - The output folder.fn - The name of the file to be generated.IOExceptionpublic void fileClosed(ManagedFileWriter mfw)
mfw - Copyright © 2023. All rights reserved.