/**
* @return a NormalAnnotation if the annotation to create has attributes or a
* MarkerAnnotation otherwise.
*/
private Annotation createAnnotation(AST ast, String name, Map<String, Boolean> attributes) {
Annotation result = null;
NormalAnnotation normalAnnotation = null;
if (attributes != null && attributes.size() > 0) {
normalAnnotation = ast.newNormalAnnotation();
result = normalAnnotation;
} else {
result = ast.newMarkerAnnotation();
}
result.setTypeName(ast.newName(name));
if (attributes != null) {
for (Entry<String, Boolean> a : attributes.entrySet()) {
MemberValuePair mvp = ast.newMemberValuePair();
mvp.setName(ast.newSimpleName(a.getKey()));
mvp.setValue(ast.newBooleanLiteral(a.getValue()));