Example usage for org.eclipse.jdt.internal.compiler.ast NormalAnnotation memberValuePairs

List of usage examples for org.eclipse.jdt.internal.compiler.ast NormalAnnotation memberValuePairs

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.ast NormalAnnotation memberValuePairs.

Prototype

MemberValuePair[] memberValuePairs

To view the source code for org.eclipse.jdt.internal.compiler.ast NormalAnnotation memberValuePairs.

Click Source Link

Usage

From source file:com.android.tools.lint.psi.EcjPsiBuilder.java

License:Apache License

@Nullable
private EcjPsiAnnotation toAnnotation(@NonNull EcjPsiSourceElement parent, @NonNull Annotation ecjAnnotation) {
    EcjPsiAnnotation psiAnnotation = new EcjPsiAnnotation(mManager, ecjAnnotation);
    parent.adoptChild(psiAnnotation);//ww w. j  a  v a 2  s .com
    EcjPsiJavaCodeReferenceElement nameElement = toTypeReference(psiAnnotation, ecjAnnotation.type);
    psiAnnotation.setNameElement(nameElement);

    //noinspection StatementWithEmptyBody
    if (ecjAnnotation instanceof MarkerAnnotation) {
        // Nothing to do
    } else if (ecjAnnotation instanceof NormalAnnotation) {
        NormalAnnotation na = (NormalAnnotation) ecjAnnotation;
        psiAnnotation.setParameterList(toAnnotationParameterList(psiAnnotation, na.memberValuePairs));
    } else if (ecjAnnotation instanceof SingleMemberAnnotation) {
        SingleMemberAnnotation na = (SingleMemberAnnotation) ecjAnnotation;
        psiAnnotation.setParameterList(toAnnotationParameterList(psiAnnotation, na.memberValuePairs()));
    }

    return psiAnnotation;
}