public final class FilerCodeWriter extends CodeWriter
CodeWriter
that generates source code to Filer
.encoding
Constructor and Description |
---|
FilerCodeWriter(Filer filer) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Called by CodeModel at the end of the process.
|
OutputStream |
openBinary(JPackage pkg,
String fileName)
Called by CodeModel to store the specified file.
|
Writer |
openSource(JPackage pkg,
String fileName)
Called by CodeModel to store the specified file.
|
public FilerCodeWriter(Filer filer)
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException
CodeWriter
The returned stream will be closed before the next file is stored. So the callee can assume that only one OutputStream is active at any given time.
openBinary
in class CodeWriter
pkg
- The package of the file to be written.fileName
- File name without the path. Something like
"Foo.java" or "Bar.properties"IOException
public Writer openSource(JPackage pkg, String fileName) throws IOException
CodeWriter
The returned stream will be closed before the next file is stored. So the callee can assume that only one OutputStream is active at any given time.
openSource
in class CodeWriter
pkg
- The package of the file to be written.fileName
- File name without the path. Something like
"Foo.java" or "Bar.properties"IOException
public void close()
CodeWriter
close
in class CodeWriter
Copyright © 2017 JBoss by Red Hat. All rights reserved.