Package com.squareup.javapoet
Class JavaFile
java.lang.Object
com.squareup.javapoet.JavaFile
A Java file containing a single top level class.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal CodeBlockprivate final Stringprivate static final Appendablefinal Stringfinal booleanfinal TypeSpec -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaFile.Builderprivate voidemit(CodeWriter codeWriter) booleanprivate voidfillAlwaysQualifiedNames(TypeSpec spec, Set<String> alwaysQualifiedNames) inthashCode()toString()voidWrites this todirectoryas UTF-8 using the standard directory structure.voidwriteTo(Appendable out) voidWrites this todirectoryas UTF-8 using the standard directory structure.voidWrites this todirectorywith the providedcharsetusing the standard directory structure.voidWrites this tofiler.writeToFile(File directory) Writes this todirectoryas UTF-8 using the standard directory structure.writeToPath(Path directory) Writes this todirectoryas UTF-8 using the standard directory structure.writeToPath(Path directory, Charset charset) Writes this todirectorywith the providedcharsetusing the standard directory structure.
-
Field Details
-
NULL_APPENDABLE
-
fileComment
-
packageName
-
typeSpec
-
skipJavaLangImports
public final boolean skipJavaLangImports -
staticImports
-
alwaysQualify
-
indent
-
-
Constructor Details
-
JavaFile
-
-
Method Details
-
fillAlwaysQualifiedNames
-
writeTo
- Throws:
IOException
-
writeTo
Writes this todirectoryas UTF-8 using the standard directory structure.- Throws:
IOException
-
writeTo
Writes this todirectorywith the providedcharsetusing the standard directory structure.- Throws:
IOException
-
writeToPath
Writes this todirectoryas UTF-8 using the standard directory structure. Returns thePathinstance to which source is actually written.- Throws:
IOException
-
writeToPath
Writes this todirectorywith the providedcharsetusing the standard directory structure. Returns thePathinstance to which source is actually written.- Throws:
IOException
-
writeTo
Writes this todirectoryas UTF-8 using the standard directory structure.- Throws:
IOException
-
writeToFile
Writes this todirectoryas UTF-8 using the standard directory structure. Returns theFileinstance to which source is actually written.- Throws:
IOException
-
writeTo
Writes this tofiler.- Throws:
IOException
-
emit
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-
toJavaFileObject
-
builder
-
toBuilder
-