psyncho wrote:
This is a total newb question. I was trying to write a validator...used some annotations like:
@Target({value=TYPE, ANNOTATION_TYPE})
@Retention(value=RUNTIME)
...and my IDE is giving me errors on those lines, saying "Retention" cannot be resolved to a type and such.
I'm sure this is super simple, maybe a dependency in a pom..
any help is much appreciated
O.k., with the proper imports this seemed to work (not sure why the documentation omits this)
import java.lang.annotation.Documented;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Retention;
import javax.validation.Constraint;
import javax.validation.Payload;
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)