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
  • 17,041
  • 6
  • 34
  • 60
ycomp
  • 8,316
  • 19
  • 57
  • 95

1 Answers1

4

Just add:

import static java.lang.annotation.ElementType.*;
leeor
  • 17,041
  • 6
  • 34
  • 60