Class JavaFile


  • public final class JavaFile
    extends java.lang.Object
    A Java file containing a single top level class.
    • Field Detail

      • NULL_APPENDABLE

        private static final java.lang.Appendable NULL_APPENDABLE
      • fileComment

        public final CodeBlock fileComment
      • packageName

        public final java.lang.String packageName
      • typeSpec

        public final TypeSpec typeSpec
      • skipJavaLangImports

        public final boolean skipJavaLangImports
      • staticImports

        private final java.util.Set<java.lang.String> staticImports
      • indent

        private final java.lang.String indent
    • Method Detail

      • writeTo

        public void writeTo​(java.lang.Appendable out)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.nio.file.Path directory)
                     throws java.io.IOException
        Writes this to directory the standard directory structure.
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.io.File directory)
                     throws java.io.IOException
        Writes this to directory the standard directory structure.
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(javax.annotation.processing.Filer filer)
                     throws java.io.IOException
        Writes this to filer.
        Throws:
        java.io.IOException
      • emit

        private void emit​(CodeWriter codeWriter)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toJavaFileObject

        public javax.tools.JavaFileObject toJavaFileObject()