public class CompilationUnitWriter extends Object implements SourceBuilder, Closeable
| Modifier and Type | Method and Description |
|---|---|
CompilationUnitWriter |
add(String fmt,
Object... args)
Appends formatted text to the source.
|
CompilationUnitWriter |
addLine(String fmt,
Object... args)
Appends a formatted line of code to the source.
|
void |
close() |
public CompilationUnitWriter add(String fmt, Object... args)
SourceBuilderFormatting is done by String.format(java.lang.String, java.lang.Object...), except that:
Package and PackageElement instances use their fully-qualified names
(no "package " prefix).
Class and TypeElement instances use their qualified names where necessary,
or shorter versions if possible.
add in interface SourceBuilderpublic CompilationUnitWriter addLine(String fmt, Object... args)
SourceBuilderFormatting is done by String.format(java.lang.String, java.lang.Object...), except that:
Package and PackageElement instances use their fully-qualified names
(no "package " prefix).
Class and TypeElement instances use their qualified names where
necessary, or shorter versions if possible.
addLine in interface SourceBuilderpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2015 Google, Inc.. All rights reserved.