public abstract class JFiler extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
JFiler()
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getEncoding()
Get the file encoding to use.
|
static JFiler |
newInstance(File target)
Get an instance which writes to the filesystem.
|
static JFiler |
newInstance(Filer filer)
Get an instance which uses an underlying
Filer. |
abstract OutputStream |
openStream(String packageName,
String fileName)
Open an output stream for writing the given file.
|
Writer |
openWriter(String packageName,
String fileName)
Open a writer for the given file.
|
void |
setEncoding(String encoding)
Set the file encoding to use.
|
public static JFiler newInstance(Filer filer)
Filer.filer - the annotation processing filerpublic static JFiler newInstance(File target)
target - the target source pathpublic String getEncoding()
public void setEncoding(String encoding)
encoding - the file encodingpublic abstract OutputStream openStream(String packageName, String fileName) throws IOException
packageName - the package namefileName - the file nameIOException - if an error occurs during writepublic Writer openWriter(String packageName, String fileName) throws IOException
openStream(String, String) and wraps
the result with an OutputStreamWriter using the configured file encoding.packageName - the package namefileName - the file nameIOException - if an error occurs during writeCopyright © 2015. All rights reserved.