public final class JavaFile
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JavaFile.Builder |
| Modifier and Type | Field and Description |
|---|---|
CodeBlock |
fileComment |
java.lang.String |
packageName |
boolean |
skipJavaLangImports |
TypeSpec |
typeSpec |
| Modifier and Type | Method and Description |
|---|---|
static JavaFile.Builder |
builder(java.lang.String packageName,
TypeSpec typeSpec) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
JavaFile.Builder |
toBuilder() |
javax.tools.JavaFileObject |
toJavaFileObject() |
java.lang.String |
toString() |
void |
writeTo(java.lang.Appendable out) |
void |
writeTo(java.io.File directory)
Writes this to
directory as UTF-8 using the standard directory structure. |
void |
writeTo(javax.annotation.processing.Filer filer)
Writes this to
filer. |
void |
writeTo(java.nio.file.Path directory)
Writes this to
directory as UTF-8 using the standard directory structure. |
void |
writeTo(java.nio.file.Path directory,
java.nio.charset.Charset charset)
Writes this to
directory with the provided charset using the standard directory
structure. |
java.io.File |
writeToFile(java.io.File directory)
Writes this to
directory as UTF-8 using the standard directory structure. |
java.nio.file.Path |
writeToPath(java.nio.file.Path directory)
Writes this to
directory as UTF-8 using the standard directory structure. |
java.nio.file.Path |
writeToPath(java.nio.file.Path directory,
java.nio.charset.Charset charset)
Writes this to
directory with the provided charset using the standard directory
structure. |
public final CodeBlock fileComment
public final java.lang.String packageName
public final TypeSpec typeSpec
public final boolean skipJavaLangImports
public void writeTo(java.lang.Appendable out)
throws java.io.IOException
java.io.IOExceptionpublic void writeTo(java.nio.file.Path directory)
throws java.io.IOException
directory as UTF-8 using the standard directory structure.java.io.IOExceptionpublic void writeTo(java.nio.file.Path directory,
java.nio.charset.Charset charset)
throws java.io.IOException
directory with the provided charset using the standard directory
structure.java.io.IOExceptionpublic java.nio.file.Path writeToPath(java.nio.file.Path directory)
throws java.io.IOException
directory as UTF-8 using the standard directory structure.
Returns the Path instance to which source is actually written.java.io.IOExceptionpublic java.nio.file.Path writeToPath(java.nio.file.Path directory,
java.nio.charset.Charset charset)
throws java.io.IOException
directory with the provided charset using the standard directory
structure.
Returns the Path instance to which source is actually written.java.io.IOExceptionpublic void writeTo(java.io.File directory)
throws java.io.IOException
directory as UTF-8 using the standard directory structure.java.io.IOExceptionpublic java.io.File writeToFile(java.io.File directory)
throws java.io.IOException
directory as UTF-8 using the standard directory structure.
Returns the File instance to which source is actually written.java.io.IOExceptionpublic void writeTo(javax.annotation.processing.Filer filer)
throws java.io.IOException
filer.java.io.IOExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic javax.tools.JavaFileObject toJavaFileObject()
public static JavaFile.Builder builder(java.lang.String packageName, TypeSpec typeSpec)
public JavaFile.Builder toBuilder()
Copyright © 2020 Square, Inc.. All Rights Reserved.