Class Annotation
java.lang.Object
io.spring.initializr.generator.language.Annotation
An annotation.
- Author:
- Andy Wilkinson, Stephane Nicoll
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDefine an attribute of an annotation.static final classBuilder for creating anAnnotation. -
Method Summary
Modifier and TypeMethodDescriptionReturn the attributes of the annotation or an empty list if the annotation has no defined attribute.Return theClassNameof the annotation.Return the imports this instance contributes.getName()Deprecated, for removal: This API element is subject to removal in a future version.static AnnotationDeprecated, for removal: This API element is subject to removal in a future version.static Annotationname(String name, Consumer<Annotation.Builder> annotation) Deprecated, for removal: This API element is subject to removal in a future version.as of 0.20.0 in favor ofof(ClassName)static Annotation.BuilderInitialize an annotationAnnotation.Builderfor the specified class name.voidwrite(IndentingWriter writer, CodeBlock.FormattingOptions options) Write this annotation using the specified writer.
-
Method Details
-
getName
Deprecated, for removal: This API element is subject to removal in a future version. -
getClassName
Return theClassNameof the annotation.- Returns:
- the class name
-
getAttributes
Return the attributes of the annotation or an empty list if the annotation has no defined attribute.- Returns:
- the attributes
-
getImports
Return the imports this instance contributes.- Returns:
- the imports.
-
of
Initialize an annotationAnnotation.Builderfor the specified class name.- Parameters:
className- the class name of the annotation- Returns:
- a builder
-
name
Deprecated, for removal: This API element is subject to removal in a future version.as of 0.20.0 in favor ofof(ClassName)Create an annotation with the specified class name.- Parameters:
name- the name of the annotation- Returns:
- an annotation with no attribute defined
-
name
@Deprecated(since="0.20.0", forRemoval=true) public static Annotation name(String name, Consumer<Annotation.Builder> annotation) Deprecated, for removal: This API element is subject to removal in a future version.as of 0.20.0 in favor ofof(ClassName)Create an annotation with the specified class name, customized by the specified consumer.- Parameters:
name- the name of the annotationannotation- a consumer of the builder- Returns:
- an annotation with no attribute defined
-
write
Write this annotation using the specified writer.- Parameters:
writer- the writer to useoptions- the formatting options to use
-
of(ClassName)