Package org.springframework.aot.generate
Class InMemoryGeneratedFiles
java.lang.Object
org.springframework.aot.generate.InMemoryGeneratedFiles
- All Implemented Interfaces:
- GeneratedFiles
GeneratedFiles implementation that keeps generated files in-memory.- Since:
- 6.0
- Author:
- Phillip Webb, Stephane Nicoll
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.aot.generate.GeneratedFilesGeneratedFiles.FileHandler, GeneratedFiles.Kind
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetGeneratedFile(GeneratedFiles.Kind kind, String path) Return theInputStreamSourceof specified file.getGeneratedFileContent(GeneratedFiles.Kind kind, String path) Return the content of the specified file.Return aMapof the generated files of a specificGeneratedFiles.Kind.voidhandleFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<GeneratedFiles.FileHandler> handler) Handle a generated file of the specifiedGeneratedFiles.Kindwith the given handler.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.aot.generate.GeneratedFilesaddClassFile, addFile, addFile, addFile, addResourceFile, addResourceFile, addResourceFile, addSourceFile, addSourceFile, addSourceFile, addSourceFile
- 
Constructor Details- 
InMemoryGeneratedFilespublic InMemoryGeneratedFiles()
 
- 
- 
Method Details- 
handleFilepublic void handleFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<GeneratedFiles.FileHandler> handler) Description copied from interface:GeneratedFilesHandle a generated file of the specifiedGeneratedFiles.Kindwith the given 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.- Specified by:
- handleFilein interface- GeneratedFiles
- Parameters:
- kind- the kind of file
- path- the relative path of the file
- handler- a consumer of a- GeneratedFiles.FileHandlerfor the file
 
- 
getGeneratedFilesReturn aMapof the generated files of a specificGeneratedFiles.Kind.- Parameters:
- kind- the kind of generated file
- Returns:
- a Mapof paths toInputStreamSourceinstances
 
- 
getGeneratedFileContent@Nullable public String getGeneratedFileContent(GeneratedFiles.Kind kind, String path) throws IOException Return the content of the specified file.- Parameters:
- kind- the kind of generated file
- path- the path of the file
- Returns:
- the file content or nullif no file could be found
- Throws:
- IOException- on read error
 
- 
getGeneratedFileReturn theInputStreamSourceof specified file.- Parameters:
- kind- the kind of generated file
- path- the path of the file
- Returns:
- the file source or nullif no file could be found
 
 
-