FileSpec

class FileSpec : Taggable

A Kotlin file containing top level objects like classes, objects, functions, properties, and type aliases.

Items are output in the following order:

  • Comment

  • Annotations

  • Package

  • Imports

  • Members

Types

Builder
Link copied to clipboard
class Builder : Taggable.Builder<FileSpec.Builder>
Companion
Link copied to clipboard
object Companion

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
tag
Link copied to clipboard
open override fun <T : Any> tag(type: Class<T>): T?
Returns the tag attached with type as a key, or null if no tag is attached with that key.
open override fun <T : Any> tag(type: KClass<T>): T?
Returns the tag attached with type as a key, or null if no tag is attached with that key.
toBuilder
Link copied to clipboard
fun toBuilder(packageName: String = this.packageName, name: String = this.name): FileSpec.Builder
toJavaFileObject
Link copied to clipboard
fun toJavaFileObject(): JavaFileObject
toString
Link copied to clipboard
open override fun toString(): String
writeTo
Link copied to clipboard
fun writeTo(directory: File)
Writes this to directory as UTF-8 using the standard directory structure.
fun writeTo(out: Appendable)
fun writeTo(directory: Path)
Writes this to directory as UTF-8 using the standard directory structure.
fun writeTo(filer: Filer)
Writes this to filer.

Properties

annotations
Link copied to clipboard
val annotations: List<AnnotationSpec>
comment
Link copied to clipboard
val comment: CodeBlock
members
Link copied to clipboard
val members: List<Any>
name
Link copied to clipboard
val name: String
packageName
Link copied to clipboard
val packageName: String
tags
Link copied to clipboard
open override val tags: Map<KClass<*>, Any>
Returns all tags.