Top Description Fields Constructors Methods
com.sun.tools.xjc

pack-priv final Class ProgressCodeWriter

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

CodeWriter that reports progress to XJCListener.

Field Summary

Modifier and TypeField and Description
private int
private final XJCListener
private final int
Inherited from com.sun.codemodel.writer.FilterCodeWriter:
core

Constructor Summary

AccessConstructor and Description
public
ProgressCodeWriter(CodeWriter output, XJCListener progress, int totalFileCount)

Method Summary

Modifier and TypeMethod and Description
public OutputStream
openBinary(JPackage pkg, String fileName)

Overrides com.sun.codemodel.writer.FilterCodeWriter.openBinary.

Called by CodeModel to store the specified file.

public Writer
openSource(JPackage pkg, String fileName)

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

Called by CodeModel to store the specified file.

private void
report(final JPackage
The package of file being written. Value of null means that file has no package.
pkg
,
final String
The file name being written. Value can't be null.
fileName
)

Report progress to XJCListener.

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

Field Detail

currentback to summary
private int current
progressback to summary
private final XJCListener progress
totalFileCountback to summary
private final int totalFileCount

Constructor Detail

ProgressCodeWriterback to summary
public ProgressCodeWriter(CodeWriter output, XJCListener progress, int totalFileCount)

Method Detail

openBinaryback to summary
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException

Overrides com.sun.codemodel.writer.FilterCodeWriter.openBinary.

Doc from com.sun.codemodel.CodeWriter.openBinary.

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
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
reportback to summary
private void report(final JPackage pkg, final String fileName)

Report progress to XJCListener.

Parameters
pkg:JPackage

The package of file being written. Value of null means that file has no package.

fileName:String

The file name being written. Value can't be null.