|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jdo.spi.persistence.utility.generator.io.IOJavaFileWriter
public class IOJavaFileWriter
This implementation of the JavaFileWriter interface is based on
File and simple StringBuffer "println"
type statements.
Use this interface in conjunction with one or more JavaClassWriter
instances to describe the class(es) in a java file.
| Constructor Summary | |
|---|---|
IOJavaFileWriter(File file)
Creates a new instance of IOJavaFileWriter. |
|
| Method Summary | |
|---|---|
void |
addClass(JavaClassWriter classWriter)
Adds a class to this source file. |
void |
addImport(String importName,
String[] comments)
Adds an import statement for this source file. |
protected static ResourceBundle |
getMessages()
|
void |
save()
Saves the file by writing out the source contents to whatever file (or alternate representation) was specified (usually by the constructor of the implementation class. |
void |
setPackage(String packageName,
String[] comments)
Sets the package for this file. |
String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IOJavaFileWriter(File file)
file - The file object which will be used at save time.| Method Detail |
|---|
protected static final ResourceBundle getMessages()
public void setPackage(String packageName,
String[] comments)
setPackage in interface JavaFileWriterpackageName - The name of the package for this source file.comments - The comments shown just above the package statement.
The comments are passed as an array so the line separators can be added
by the implementation. Note that not all implementations will choose
to make use of this comment.
public void addImport(String importName,
String[] comments)
addImport in interface JavaFileWriterimportName - Name of the class or package (including the *) to be
imported. This string should not contain "import" or the ;comments - The comments shown just above the import statement.
The comments are passed as an array so the line separators can be added
by the implementation. Note that not all implementations will choose
to make use of this comment.public void addClass(JavaClassWriter classWriter)
addClass in interface JavaFileWriterclassWriter - The definition of the class.
public void save()
throws IOException
save in interface JavaFileWriterIOException - If the file cannot be saved.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||