Top Description Fields Constructors Methods
com.sun.codemodel.writer

public Class PrologCodeWriter

extends FilterCodeWriter
Class Inheritance
Imports
java.io.IOException, .PrintWriter, .Writer, com.sun.codemodel.CodeWriter, .JPackage

Writes all the source files under the specified file folder and inserts a file prolog comment in each java source file.
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
private final String
prolog

prolog comment

Inherited from com.sun.codemodel.writer.FilterCodeWriter:
core

Constructor Summary

AccessConstructor and Description
public
PrologCodeWriter(CodeWriter
This CodeWriter will be used to actually create a storage for files. PrologCodeWriter simply decorates this underlying CodeWriter by adding prolog comments.
core
,
String
Strings that will be added as comments. This string may contain newlines to produce multi-line comments. '//' will be inserted at the beginning of each line to make it a valid Java comment, so the caller can just pass strings like "abc\ndef"
prolog
)

Method Summary

Modifier and TypeMethod and Description
public Writer
openSource(JPackage pkg, String fileName)

Overrides com.sun.codemodel.writer.FilterCodeWriter.openSource.

Called by CodeModel to store the specified file.

Inherited from com.sun.codemodel.writer.FilterCodeWriter:
closeopenBinary

Field Detail

prologback to summary
private final String prolog

prolog comment

Constructor Detail

PrologCodeWriterback to summary
public PrologCodeWriter(CodeWriter core, String prolog)
Parameters
core:CodeWriter

This CodeWriter will be used to actually create a storage for files. PrologCodeWriter simply decorates this underlying CodeWriter by adding prolog comments.

prolog:String

Strings that will be added as comments. This string may contain newlines to produce multi-line comments. '//' will be inserted at the beginning of each line to make it a valid Java comment, so the caller can just pass strings like "abc\ndef"

Method Detail

openSourceback to summary
public Writer openSource(JPackage pkg, String fileName) throws IOException

Overrides com.sun.codemodel.writer.FilterCodeWriter.openSource.

Doc from com.sun.codemodel.CodeWriter.openSource.

Called by CodeModel to store the specified file. The callee must allocate a storage to store the specified file.

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.

Annotations
@Override