See gh-31331
This commit is contained in:
Stephane Nicoll
2024-06-24 18:04:42 +02:00
parent 8ef74dfdad
commit 0ea7af7465
2 changed files with 111 additions and 19 deletions

View File

@@ -170,11 +170,14 @@ public abstract class GeneratedFiles {
}
/**
* Add a generated file of the specified {@link Kind} with the given
* {@linkplain FileHandler handler}.
* @param kind the kind of file being written
* Handle a generated file of the specified {@link Kind} with the given
* {@linkplain FileHandler handler}. The file handler lets you consume
* the content of the already generated file, if any and provide a way
* to override its content if necessary.
* @param kind the kind of file
* @param path the relative path of the file
* @param handler a consumer of a {@link FileHandler} for the file
* @since 6.2
*/
public abstract void handleFile(Kind kind, String path, ThrowingConsumer<FileHandler> handler);
@@ -235,6 +238,8 @@ public abstract class GeneratedFiles {
/**
* Provide access to a particular file and offer convenient method to save
* or override its content.
*
* @since 6.2
*/
public abstract static class FileHandler {