Class Annotation

java.lang.Object
io.spring.initializr.generator.language.Annotation

public final class Annotation extends Object
An annotation.
Author:
Andy Wilkinson, Stephane Nicoll
  • Method Details

    • getClassName

      public ClassName getClassName()
      Return the ClassName of the annotation.
      Returns:
      the class name
    • getAttributes

      public List<Annotation.Attribute> getAttributes()
      Return the attributes of the annotation or an empty list if the annotation has no defined attribute.
      Returns:
      the attributes
    • getImports

      public List<String> getImports()
      Return the imports this instance contributes.
      Returns:
      the imports.
    • of

      public static Annotation.Builder of(ClassName className)
      Initialize an annotation Annotation.Builder for the specified class name.
      Parameters:
      className - the class name of the annotation
      Returns:
      a builder
    • write

      public void write(IndentingWriter writer, CodeBlock.FormattingOptions options)
      Write this annotation using the specified writer.
      Parameters:
      writer - the writer to use
      options - the formatting options to use