ICompilationUnit ic = a.getCompilationUnit();
CompilationUnit cu = (CompilationUnit) ic;
ASTParser astParser = ASTParser.newParser(AST.JLS3);
astParser.setSource(cu.getContents());
ASTNode node = astParser
.createAST(new NullProgressMonitor());
ASTNode aNode = a
.findNode((org.eclipse.jdt.core.dom.CompilationUnit) node);
if (aNode instanceof NormalAnnotation) {
NormalAnnotation na = (NormalAnnotation) aNode;
Expression exp = getAnnotationElement(na, "members");
parseAnnotationListElement(elems, annotationName,
nameProp, colProp, exp);
}
}
}
} catch (JavaModelException e) {
e.printStackTrace();
}
} else {
try {
ias = f.getAnnotations();
String annotationSetName = "AttributeOverrides";
String annotationName = "AttributeOverride";
String nameProp = "name";
String colProp = "column";
for (IAnnotation ia : ias) {
if (ia.getElementName().equals(annotationSetName)) {
if (ia instanceof Annotation) {
Annotation a = (Annotation) ia;
ICompilationUnit ic = a.getCompilationUnit();
CompilationUnit cu = (CompilationUnit) ic;
ASTParser astParser = ASTParser.newParser(AST.JLS3);
astParser.setSource(cu.getContents());
ASTNode node = astParser
.createAST(new NullProgressMonitor());
ASTNode aNode = a
.findNode((org.eclipse.jdt.core.dom.CompilationUnit) node);
if (aNode instanceof SingleMemberAnnotation) {
SingleMemberAnnotation sma = (SingleMemberAnnotation) aNode;
Expression val = sma.getValue();
parseAnnotationListElement(elems,
annotationName, nameProp, colProp, val);
}
}
} else if (ia.getElementName().equals(annotationName)) {
Annotation a = (Annotation) ia;
ICompilationUnit ic = a.getCompilationUnit();
CompilationUnit cu = (CompilationUnit) ic;
ASTParser astParser = ASTParser.newParser(AST.JLS3);
astParser.setSource(cu.getContents());
ASTNode node = astParser
.createAST(new NullProgressMonitor());
ASTNode aNode = a
.findNode((org.eclipse.jdt.core.dom.CompilationUnit) node);
if (aNode instanceof NormalAnnotation) {
parseAnnotationElement(elems, annotationName,
nameProp, colProp, aNode);
}