public static class DynamicEntityLoader.TmpJavaFileObject extends SimpleJavaFileObject
JavaFileObject.Kindkind, uri| 构造器和说明 |
|---|
TmpJavaFileObject(String name,
JavaFileObject.Kind kind)
构造用来存储字节码的JavaFileObject
需要传入kind,即我们想要构建一个存储什么类型文件的JavaFileObject
|
TmpJavaFileObject(String name,
String source)
构造用来存储源代码的JavaFileObject
需要传入源码source,然后调用父类的构造方法创建kind = Kind.SOURCE的JavaFileObject对象
|
| 限定符和类型 | 方法和说明 |
|---|---|
CharSequence |
getCharContent(boolean ignoreEncodingErrors) |
byte[] |
getCompiledBytes() |
OutputStream |
openOutputStream() |
delete, getAccessLevel, getKind, getLastModified, getName, getNestingKind, isNameCompatible, openInputStream, openReader, openWriter, toString, toUripublic TmpJavaFileObject(String name, String source)
public TmpJavaFileObject(String name, JavaFileObject.Kind kind)
public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException
getCharContent 在接口中 FileObjectgetCharContent 在类中 SimpleJavaFileObjectIOExceptionpublic OutputStream openOutputStream() throws IOException
openOutputStream 在接口中 FileObjectopenOutputStream 在类中 SimpleJavaFileObjectIOExceptionpublic byte[] getCompiledBytes()
Copyright © 2023. All rights reserved.