FileCodeWriter, FilterCodeWriter, OutputStreamCodeWriter, SingleStreamCodeWriter, ZipCodeWriterpublic abstract class CodeWriter
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
protected java.lang.String |
encoding |
Encoding to be used by the writer.
|
| Constructor | Description |
|---|---|
CodeWriter() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract void |
close() |
Called by CodeModel at the end of the process.
|
abstract java.io.OutputStream |
openBinary(JPackage pkg,
java.lang.String fileName) |
Called by CodeModel to store the specified file.
|
java.io.Writer |
openSource(JPackage pkg,
java.lang.String fileName) |
Called by CodeModel to store the specified file.
|
protected java.lang.String encoding
public abstract java.io.OutputStream openBinary(JPackage pkg, java.lang.String fileName) throws java.io.IOException
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.
pkg - The package of the file to be written.fileName - File name without the path. Something like
"Foo.java" or "Bar.properties"java.io.IOExceptionpublic java.io.Writer openSource(JPackage pkg, java.lang.String fileName) throws java.io.IOException
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.
pkg - The package of the file to be written.fileName - File name without the path. Something like
"Foo.java" or "Bar.properties"java.io.IOExceptionpublic abstract void close()
throws java.io.IOException
java.io.IOExceptionCopyright © 2017 Oracle Corporation. All rights reserved.