Package org.springframework.aot.generate
Interface GeneratedFiles
- All Known Implementing Classes:
FileSystemGeneratedFiles
,InMemoryGeneratedFiles
public interface GeneratedFiles
Interface that can be used to add
source
,
resource
or class
files generated
during ahead-of-time processing. Source and resource files are written using
UTF-8 encoding.- Since:
- 6.0
- Author:
- Phillip Webb, Brian Clozel, Stephane Nicoll
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The various kinds of generated files that are supported. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
addClassFile
(String path, InputStreamSource content) Add a generatedclass file
with content from the givenInputStreamSource
.default void
addFile
(GeneratedFiles.Kind kind, String path, CharSequence content) Add a generated file of the specifiedGeneratedFiles.Kind
with content from the givenCharSequence
.void
addFile
(GeneratedFiles.Kind kind, String path, InputStreamSource content) Add a generated file of the specifiedGeneratedFiles.Kind
with content from the givenInputStreamSource
.default void
addFile
(GeneratedFiles.Kind kind, String path, ThrowingConsumer<Appendable> content) Add a generated file of the specifiedGeneratedFiles.Kind
with content written to anAppendable
passed to the givenThrowingConsumer
.default void
addResourceFile
(String path, CharSequence content) Add a generatedresource file
with content from the givenCharSequence
.default void
addResourceFile
(String path, InputStreamSource content) Add a generatedresource file
with content from the givenInputStreamSource
.default void
addResourceFile
(String path, ThrowingConsumer<Appendable> content) Add a generatedresource file
with content written to anAppendable
passed to the givenThrowingConsumer
.default void
addSourceFile
(String className, CharSequence content) Add a generatedsource file
with content from the givenCharSequence
.default void
addSourceFile
(String className, InputStreamSource content) Add a generatedsource file
with content from the givenInputStreamSource
.default void
addSourceFile
(String className, ThrowingConsumer<Appendable> content) Add a generatedsource file
with content written to anAppendable
passed to the givenThrowingConsumer
.default void
addSourceFile
(org.springframework.javapoet.JavaFile javaFile) Add a generatedsource file
with content from the givenJavaFile
.
-
Method Details
-
addSourceFile
default void addSourceFile(org.springframework.javapoet.JavaFile javaFile) Add a generatedsource file
with content from the givenJavaFile
.- Parameters:
javaFile
- the java file to add
-
addSourceFile
Add a generatedsource file
with content from the givenCharSequence
.- Parameters:
className
- the class name that should be used to determine the path of the filecontent
- the contents of the file
-
addSourceFile
Add a generatedsource file
with content written to anAppendable
passed to the givenThrowingConsumer
.- Parameters:
className
- the class name that should be used to determine the path of the filecontent
- aThrowingConsumer
that accepts anAppendable
which will receive the file contents
-
addSourceFile
Add a generatedsource file
with content from the givenInputStreamSource
.- Parameters:
className
- the class name that should be used to determine the path of the filecontent
- anInputStreamSource
that will provide an input stream containing the file contents
-
addResourceFile
Add a generatedresource file
with content from the givenCharSequence
.- Parameters:
path
- the relative path of the filecontent
- the contents of the file
-
addResourceFile
Add a generatedresource file
with content written to anAppendable
passed to the givenThrowingConsumer
.- Parameters:
path
- the relative path of the filecontent
- aThrowingConsumer
that accepts anAppendable
which will receive the file contents
-
addResourceFile
Add a generatedresource file
with content from the givenInputStreamSource
.- Parameters:
path
- the relative path of the filecontent
- anInputStreamSource
that will provide an input stream containing the file contents
-
addClassFile
Add a generatedclass file
with content from the givenInputStreamSource
.- Parameters:
path
- the relative path of the filecontent
- anInputStreamSource
that will provide an input stream containing the file contents
-
addFile
Add a generated file of the specifiedGeneratedFiles.Kind
with content from the givenCharSequence
.- Parameters:
kind
- the kind of file being writtenpath
- the relative path of the filecontent
- the contents of the file
-
addFile
Add a generated file of the specifiedGeneratedFiles.Kind
with content written to anAppendable
passed to the givenThrowingConsumer
.- Parameters:
kind
- the kind of file being writtenpath
- the relative path of the filecontent
- aThrowingConsumer
that accepts anAppendable
which will receive the file contents
-
addFile
Add a generated file of the specifiedGeneratedFiles.Kind
with content from the givenInputStreamSource
.- Parameters:
kind
- the kind of file being writtenpath
- the relative path of the filecontent
- anInputStreamSource
that will provide an input stream containing the file contents
-