Package com.squareup.javapoet
Class AnnotationSpec
- java.lang.Object
-
- com.squareup.javapoet.AnnotationSpec
-
public final class AnnotationSpec extends java.lang.Object
A generated annotation on a declaration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnnotationSpec.Builder
private static class
AnnotationSpec.Visitor
Annotation value visitor adding members to the given builder instance.
-
Constructor Summary
Constructors Modifier Constructor Description private
AnnotationSpec(AnnotationSpec.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AnnotationSpec.Builder
builder(ClassName type)
static AnnotationSpec.Builder
builder(java.lang.Class<?> type)
(package private) void
emit(CodeWriter codeWriter, boolean inline)
private void
emitAnnotationValues(CodeWriter codeWriter, java.lang.String whitespace, java.lang.String memberSeparator, java.util.List<CodeBlock> values)
boolean
equals(java.lang.Object o)
static AnnotationSpec
get(java.lang.annotation.Annotation annotation)
static AnnotationSpec
get(java.lang.annotation.Annotation annotation, boolean includeDefaultValues)
static AnnotationSpec
get(javax.lang.model.element.AnnotationMirror annotation)
int
hashCode()
AnnotationSpec.Builder
toBuilder()
java.lang.String
toString()
-
-
-
Constructor Detail
-
AnnotationSpec
private AnnotationSpec(AnnotationSpec.Builder builder)
-
-
Method Detail
-
emit
void emit(CodeWriter codeWriter, boolean inline) throws java.io.IOException
- Throws:
java.io.IOException
-
emitAnnotationValues
private void emitAnnotationValues(CodeWriter codeWriter, java.lang.String whitespace, java.lang.String memberSeparator, java.util.List<CodeBlock> values) throws java.io.IOException
- Throws:
java.io.IOException
-
get
public static AnnotationSpec get(java.lang.annotation.Annotation annotation)
-
get
public static AnnotationSpec get(java.lang.annotation.Annotation annotation, boolean includeDefaultValues)
-
get
public static AnnotationSpec get(javax.lang.model.element.AnnotationMirror annotation)
-
builder
public static AnnotationSpec.Builder builder(ClassName type)
-
builder
public static AnnotationSpec.Builder builder(java.lang.Class<?> type)
-
toBuilder
public AnnotationSpec.Builder toBuilder()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-