| Constructor and Description |
|---|
Emitter() |
| Modifier and Type | Method and Description |
|---|---|
static TypeDeclaration |
findPrimaryType(CompilationUnit unit)
Returns a primary type declaration in the compilation unit.
|
PrintWriter |
openFor(CompilationUnit unit)
Creates a new Java source file and returns the writer for writing the contents of the file.
|
abstract PrintWriter |
openFor(PackageDeclaration packageDeclOrNull,
String subPath)
Creates a new resource file and returns the writer for writing the contents of the resource.
|
public PrintWriter openFor(CompilationUnit unit) throws IOException
unit - the target compilation unitIOException - if error was occurred while creating the target source fileIllegalArgumentException - if the parameter is nullpublic static TypeDeclaration findPrimaryType(CompilationUnit unit)
public type,
or the first type in the compilation unit.unit - the target compilation unitnull if the compilation unit does not contain any typesIllegalArgumentException - if the parameter is nullpublic abstract PrintWriter openFor(PackageDeclaration packageDeclOrNull, String subPath) throws IOException
packageDeclOrNull - the base package, or null if it is the default (unnamed) packagesubPath - the relative path from the base packageIOException - if error was occurred while creating the target resourceIllegalArgumentException - if the parameter is nullCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.