public class AnnotationMetadataBuilder extends Object implements org.springframework.roo.model.Builder<AnnotationMetadata>
AnnotationMetadata.
The "add" method will replace any existing annotation attribute with the same name, taking care to preserve its location.
| Modifier and Type | Field and Description |
|---|---|
static AnnotationMetadata |
JPA_COLUMN_ANNOTATION |
static AnnotationMetadata |
JPA_EMBEDDED_ANNOTATION |
static AnnotationMetadata |
JPA_EMBEDDED_ID_ANNOTATION |
static AnnotationMetadata |
JPA_ENUMERATED_ANNOTATION |
static AnnotationMetadata |
JPA_ID_ANNOTATION |
static AnnotationMetadata |
JPA_LOB_ANNOTATION |
static AnnotationMetadata |
JPA_MANY_TO_MANY_ANNOTATION |
static AnnotationMetadata |
JPA_MANY_TO_ONE_ANNOTATION |
static AnnotationMetadata |
JPA_ONE_TO_MANY_ANNOTATION |
static AnnotationMetadata |
JPA_ONE_TO_ONE_ANNOTATION |
static AnnotationMetadata |
JPA_TRANSIENT_ANNOTATION |
static AnnotationMetadata |
JPA_VERSION_ANNOTATION |
| Constructor and Description |
|---|
AnnotationMetadataBuilder()
Constructor.
|
AnnotationMetadataBuilder(AnnotationMetadata existing)
Constructor for using an existing
AnnotationMetadata as a
baseline for building a new instance. |
AnnotationMetadataBuilder(Class<?> annotationType)
Constructor for no initial attribute values
|
AnnotationMetadataBuilder(org.springframework.roo.model.JavaType annotationType)
Constructor for no initial attribute values
|
AnnotationMetadataBuilder(org.springframework.roo.model.JavaType annotationType,
Collection<AnnotationAttributeValue<?>> attributeValues)
Constructor that accepts an optional list of values
|
AnnotationMetadataBuilder(String annotationType)
Constructor for no initial attribute values
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(AnnotationAttributeValue<?> value) |
void |
addBooleanAttribute(String key,
boolean value) |
void |
addCharAttribute(String key,
char value) |
void |
addClassAttribute(String key,
org.springframework.roo.model.JavaType javaType)
Adds an attribute with the given
JavaType as its value |
void |
addClassAttribute(String key,
String fullyQualifiedTypeName) |
void |
addDoubleAttribute(String key,
double value,
boolean floatingPrecisionOnly) |
void |
addEnumAttribute(String key,
org.springframework.roo.model.EnumDetails details) |
void |
addEnumAttribute(String key,
org.springframework.roo.model.JavaType javaType,
org.springframework.roo.model.JavaSymbolName enumConstant) |
void |
addEnumAttribute(String key,
org.springframework.roo.model.JavaType javaType,
String enumConstant) |
void |
addEnumAttribute(String key,
String fullyQualifiedTypeName,
String enumConstant) |
void |
addIntegerAttribute(String key,
int value) |
void |
addLongAttribute(String key,
long value) |
void |
addStringAttribute(String key,
String value) |
AnnotationMetadata |
build() |
org.springframework.roo.model.JavaType |
getAnnotationType() |
Map<String,AnnotationAttributeValue<?>> |
getAttributes() |
CommentStructure |
getCommentStructure() |
static AnnotationMetadata |
getInstance(Class<?> annotationType)
Returns the metadata for the existing annotation, with no attribute
values
|
static AnnotationMetadata |
getInstance(org.springframework.roo.model.JavaType annotationType) |
static AnnotationMetadataBuilder |
getInstance(org.springframework.roo.model.JavaType annotationType,
Collection<AnnotationAttributeValue<?>> attributeValues) |
static AnnotationMetadata |
getInstance(String annotationType)
Returns the metadata for the existing annotation, with no attribute
values
|
void |
removeAttribute(String key) |
void |
setAnnotationType(org.springframework.roo.model.JavaType annotationType) |
void |
setAttributes(Collection<AnnotationAttributeValue<?>> attributeValues)
Sets the attribute values
|
void |
setCommentStructure(CommentStructure commentStructure) |
public static final AnnotationMetadata JPA_COLUMN_ANNOTATION
public static final AnnotationMetadata JPA_EMBEDDED_ANNOTATION
public static final AnnotationMetadata JPA_EMBEDDED_ID_ANNOTATION
public static final AnnotationMetadata JPA_ENUMERATED_ANNOTATION
public static final AnnotationMetadata JPA_ID_ANNOTATION
public static final AnnotationMetadata JPA_LOB_ANNOTATION
public static final AnnotationMetadata JPA_MANY_TO_MANY_ANNOTATION
public static final AnnotationMetadata JPA_MANY_TO_ONE_ANNOTATION
public static final AnnotationMetadata JPA_ONE_TO_MANY_ANNOTATION
public static final AnnotationMetadata JPA_ONE_TO_ONE_ANNOTATION
public static final AnnotationMetadata JPA_TRANSIENT_ANNOTATION
public static final AnnotationMetadata JPA_VERSION_ANNOTATION
public AnnotationMetadataBuilder()
setAnnotationType(JavaType) before calling build()public AnnotationMetadataBuilder(AnnotationMetadata existing)
AnnotationMetadata as a
baseline for building a new instance.existing - requiredpublic AnnotationMetadataBuilder(Class<?> annotationType)
annotationType - the annotation class (required)public AnnotationMetadataBuilder(org.springframework.roo.model.JavaType annotationType)
annotationType - public AnnotationMetadataBuilder(org.springframework.roo.model.JavaType annotationType,
Collection<AnnotationAttributeValue<?>> attributeValues)
annotationType - attributeValues - can be nullpublic AnnotationMetadataBuilder(String annotationType)
annotationType - the fully-qualified name of the annotation type
(required)public static AnnotationMetadata getInstance(Class<?> annotationType)
annotationType - the annotation type (required)null instancepublic static AnnotationMetadata getInstance(org.springframework.roo.model.JavaType annotationType)
public static AnnotationMetadataBuilder getInstance(org.springframework.roo.model.JavaType annotationType, Collection<AnnotationAttributeValue<?>> attributeValues)
public static AnnotationMetadata getInstance(String annotationType)
annotationType - the fully-qualified name of the annotation type
(required)null instancepublic void addAttribute(AnnotationAttributeValue<?> value)
public void addBooleanAttribute(String key, boolean value)
public void addCharAttribute(String key, char value)
public void addClassAttribute(String key, org.springframework.roo.model.JavaType javaType)
JavaType as its valuekey - the attribute name (required)javaType - the value (required)public void addDoubleAttribute(String key, double value, boolean floatingPrecisionOnly)
public void addEnumAttribute(String key, org.springframework.roo.model.EnumDetails details)
public void addEnumAttribute(String key, org.springframework.roo.model.JavaType javaType, org.springframework.roo.model.JavaSymbolName enumConstant)
public void addEnumAttribute(String key, org.springframework.roo.model.JavaType javaType, String enumConstant)
public void addEnumAttribute(String key, String fullyQualifiedTypeName, String enumConstant)
public void addIntegerAttribute(String key, int value)
public void addLongAttribute(String key, long value)
public AnnotationMetadata build()
build in interface org.springframework.roo.model.Builder<AnnotationMetadata>public org.springframework.roo.model.JavaType getAnnotationType()
public Map<String,AnnotationAttributeValue<?>> getAttributes()
public void removeAttribute(String key)
public void setAnnotationType(org.springframework.roo.model.JavaType annotationType)
public void setAttributes(Collection<AnnotationAttributeValue<?>> attributeValues)
attributeValues - the values to set; can be null for
nonepublic CommentStructure getCommentStructure()
public void setCommentStructure(CommentStructure commentStructure)
Copyright © 2009–2018 Pivotal Software, Inc.. All rights reserved.