PsiAnnotationUtil.getAnnotationValue(psiAnnotation, "condition", GSType.class)

Hi,


I have annoation which has methods taking value as enum

@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE})
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE)
public @interface GettersSetters {
    lombok.teja.gs.GSType condition() default lombok.teja.gs.GSType.BOTH;
}


In the plugin how to I get the value of condition.

I have tried PsiAnnotationUtil.getAnnotationValue(psiAnnotation, "condition", GSType.class) but this is giving value null.

My enum class is

package lombok.teja.gs;

public enum GSType {
    BOTH, ONLY_GETTERS, ONLY_SETTERS;

    public static lombok.teja.gs.GSType[] values() { /* compiled code */ }

    public static lombok.teja.gs.GSType valueOf(java.lang.String name) { /* compiled code */ }

    private GSType() { /* compiled code */ }
}


Regards,
Nagendra

0
1 comment

There is no PsiAnnotationUtil in the current IDEA sources. PsiImplUtil hosts a number of annotation-related methods though.

0

Please sign in to leave a comment.