MarkerAnnotation markerAnnotation =
annotation(declaration, MarkerAnnotation.class);
if (markerAnnotation != null) {
AST ast = markerAnnotation.getAST();
if (value != QualifiedNameValue.DEFAULT_VALUE) {
SingleMemberAnnotation replacementAnnotation = ast.newSingleMemberAnnotation();
replacementAnnotation.setTypeName(ast.newName(markerAnnotation.getTypeName().getFullyQualifiedName()));
Expression memberValueExpression =
value != null? AstUtils.createExpression(
ast, value): null;
replacementAnnotation.setValue(memberValueExpression);