use of org.springframework.roo.classpath.details.DeclaredFieldAnnotationDetails in project spring-roo by spring-projects.
the class JavaBeanMetadata method processGaeAnnotations.
private void processGaeAnnotations(final FieldMetadata field) {
for (final AnnotationMetadata annotation : field.getAnnotations()) {
if (annotation.getAnnotationType().equals(ONE_TO_ONE) || annotation.getAnnotationType().equals(MANY_TO_ONE) || annotation.getAnnotationType().equals(ONE_TO_MANY) || annotation.getAnnotationType().equals(MANY_TO_MANY)) {
builder.addFieldAnnotation(new DeclaredFieldAnnotationDetails(field, new AnnotationMetadataBuilder(annotation.getAnnotationType()).build(), true));
builder.addFieldAnnotation(new DeclaredFieldAnnotationDetails(field, new AnnotationMetadataBuilder(TRANSIENT).build()));
break;
}
}
}
use of org.springframework.roo.classpath.details.DeclaredFieldAnnotationDetails in project spring-roo by spring-projects.
the class ItdSourceFileComposer method appendFieldAnnotations.
private void appendFieldAnnotations() {
final List<DeclaredFieldAnnotationDetails> fieldAnnotations = itdTypeDetails.getFieldAnnotations();
if (fieldAnnotations == null || fieldAnnotations.isEmpty()) {
return;
}
content = true;
for (final DeclaredFieldAnnotationDetails fieldDetails : fieldAnnotations) {
appendIndent();
append("declare @field: * ");
append(introductionTo.getSimpleTypeName());
append(".");
append(fieldDetails.getField().getFieldName().getSymbolName());
append(": ");
if (fieldDetails.isRemoveAnnotation()) {
append("-");
}
outputAnnotation(fieldDetails.getFieldAnnotation());
append(";");
this.newLine(false);
this.newLine();
}
}
Aggregations