Top "Annotations" questions

In programming, annotations are used to add information to a code element which cannot be expressed by the type system.

Selenium @FindBy vs driver.findElement()

Why should I use @FindBy vs driver.findElement()? @FindBy forces me to move all my variables to a class level (…

selenium selenium-webdriver annotations findby page-factory
How to delete all Annotations on a MKMapView

Is there a simple way to delete all the annotations on a map without iterating through all the displayed annotations …

objective-c iphone-sdk-3.0 annotations mkmapview
@Pattern for alphanumeric string - Bean validation

I have a variable name in a bean. I want to add @Pattern validation to accept only alphanumeric. Currently, I …

java regex annotations bean-validation
Add a Servlet Filter in a Spring Boot application

I'd like to have ETag suport. For this purpose there is a ShallowEtagHeaderFilter which does all the work. How can …

spring annotations servlet-filters spring-boot
How to set String Array in Java Annotation

I have declared a annotation like this: public @interface CustomAnnot { String[] author() default "me"; String description() default ""; } A valid Annotation …

java annotations
can someone please explain me @MapsId in hibernate?

Can someone please explain to me @MapsId in hibernate? I'm having a hard time understanding it. It would be great …

java hibernate jpa annotations hibernate-annotations
Why java classes do not inherit annotations from implemented interfaces?

I've been using Guice's AOP to intercept some method calls. My class implements an interface and I would like to …

java inheritance interface annotations guice
How can I add xml attributes to jaxb annotated class XmlElementWrapper?

I have a class with a XmlElementWrapper annotation like: ... @XmlElementWrapper(name="myList") @XmlElements({ @XmlElement(name="myElement") } ) private List<SomeType&…

xml annotations jaxb linked-list
How do different retention policies affect my annotations?

Can anyone explain in a clear way the practical differences between the java.lang.annotation.RetentionPolicy constants SOURCE, CLASS, and …

java annotations
java custom annotation: make an attribute optional

I defined my own custom annotation @Target(value={ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface MyCustomAnnotation { Class<?&…

java annotations metaprogramming