0

A bit new to defining custom annotations, what am I doing wrong:

from: Target : Standard Annotations « Language « Java Tutorial

You can have multiple values in the Target annotation.

@Target(value={TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})

However, I can't get this to work in my IDE

I must do something like this:

@Target(value={ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE})

What am I doing wrong?

I'm using IntelliJ 14

leeor
  • 15,861
  • 6
  • 32
  • 58
ycomp
  • 7,646
  • 18
  • 55
  • 86

1 Answers1

4

Just add:

import static java.lang.annotation.ElementType.*;
leeor
  • 15,861
  • 6
  • 32
  • 58