public class FileCodeWriter extends CodeWriter
encoding
Constructor | Description |
---|---|
FileCodeWriter(java.io.File target) |
|
FileCodeWriter(java.io.File target,
boolean readOnly) |
|
FileCodeWriter(java.io.File target,
boolean readOnly,
java.lang.String encoding) |
|
FileCodeWriter(java.io.File target,
java.lang.String encoding) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Called by CodeModel at the end of the process.
|
protected java.io.File |
getFile(JPackage pkg,
java.lang.String fileName) |
|
java.io.OutputStream |
openBinary(JPackage pkg,
java.lang.String fileName) |
Called by CodeModel to store the specified file.
|
openSource
public FileCodeWriter(java.io.File target) throws java.io.IOException
java.io.IOException
public FileCodeWriter(java.io.File target, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public FileCodeWriter(java.io.File target, boolean readOnly) throws java.io.IOException
java.io.IOException
public FileCodeWriter(java.io.File target, boolean readOnly, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public java.io.OutputStream openBinary(JPackage pkg, java.lang.String fileName) throws java.io.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"java.io.IOException
protected java.io.File getFile(JPackage pkg, java.lang.String fileName) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
CodeWriter
close
in class CodeWriter
java.io.IOException
Copyright © 2018 Oracle Corporation. All rights reserved.