接口 GeneratedFiles
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.- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Brian Clozel, Stephane Nicoll, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型接口说明static enumThe various kinds of generated files that are supported. -
方法概要
修饰符和类型方法说明default voidaddClassFile(String path, InputStreamSource content) Add a generatedclass filewith content from the givenInputStreamSource.voidaddFile(GeneratedFiles.Kind kind, String path, InputStreamSource content) Add a generated file of the specifiedGeneratedFiles.Kindwith content from the givenInputStreamSource.default voidaddFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<Appendable> content) Add a generated file of the specifiedGeneratedFiles.Kindwith content written to anAppendablepassed to the givenThrowingConsumer.default voidaddFile(GeneratedFiles.Kind kind, String path, CharSequence content) Add a generated file of the specifiedGeneratedFiles.Kindwith content from the givenCharSequence.default voidaddResourceFile(String path, InputStreamSource content) Add a generatedresource filewith content from the givenInputStreamSource.default voidaddResourceFile(String path, ThrowingConsumer<Appendable> content) Add a generatedresource filewith content written to anAppendablepassed to the givenThrowingConsumer.default voidaddResourceFile(String path, CharSequence content) Add a generatedresource filewith content from the givenCharSequence.default voidaddSourceFile(cn.taketoday.javapoet.JavaFile javaFile) Add a generatedsource filewith content from the givenJavaFile.default voidaddSourceFile(String className, InputStreamSource content) Add a generatedsource filewith content from the givenInputStreamSource.default voidaddSourceFile(String className, ThrowingConsumer<Appendable> content) Add a generatedsource filewith content written to anAppendablepassed to the givenThrowingConsumer.default voidaddSourceFile(String className, CharSequence content) Add a generatedsource filewith content from the givenCharSequence.private static StringgetClassNamePath(String className) private static booleanisJavaIdentifier(String className) private static voidvalidatePackage(String packageName, String className)
-
方法详细资料
-
addSourceFile
default void addSourceFile(cn.taketoday.javapoet.JavaFile javaFile) Add a generatedsource filewith content from the givenJavaFile.- 参数:
javaFile- the java file to add
-
addSourceFile
Add a generatedsource filewith content from the givenCharSequence.- 参数:
className- the class name that should be used to determine the path of the filecontent- the contents of the file
-
addSourceFile
Add a generatedsource filewith content written to anAppendablepassed to the givenThrowingConsumer.- 参数:
className- the class name that should be used to determine the path of the filecontent- aThrowingConsumerthat accepts anAppendablewhich will receive the file contents
-
addSourceFile
Add a generatedsource filewith content from the givenInputStreamSource.- 参数:
className- the class name that should be used to determine the path of the filecontent- anInputStreamSourcethat will provide an input stream containing the file contents
-
addResourceFile
Add a generatedresource filewith content from the givenCharSequence.- 参数:
path- the relative path of the filecontent- the contents of the file
-
addResourceFile
Add a generatedresource filewith content written to anAppendablepassed to the givenThrowingConsumer.- 参数:
path- the relative path of the filecontent- aThrowingConsumerthat accepts anAppendablewhich will receive the file contents
-
addResourceFile
Add a generatedresource filewith content from the givenInputStreamSource.- 参数:
path- the relative path of the filecontent- anInputStreamSourcethat will provide an input stream containing the file contents
-
addClassFile
Add a generatedclass filewith content from the givenInputStreamSource.- 参数:
path- the relative path of the filecontent- anInputStreamSourcethat will provide an input stream containing the file contents
-
addFile
Add a generated file of the specifiedGeneratedFiles.Kindwith content from the givenCharSequence.- 参数:
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.Kindwith content written to anAppendablepassed to the givenThrowingConsumer.- 参数:
kind- the kind of file being writtenpath- the relative path of the filecontent- aThrowingConsumerthat accepts anAppendablewhich will receive the file contents
-
addFile
Add a generated file of the specifiedGeneratedFiles.Kindwith content from the givenInputStreamSource.- 参数:
kind- the kind of file being writtenpath- the relative path of the filecontent- anInputStreamSourcethat will provide an input stream containing the file contents
-
getClassNamePath
-
validatePackage
-
isJavaIdentifier
-