Top "Annotations" questions

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

Is it possible to read the value of a annotation in java?

this is my code: @Column(columnName="firstname") private String firstName; @Column(columnName="lastname") private String lastName; public String getFirstName() { return …

java annotations getter-setter java-6
Spring MVC: difference between <context:component-scan> and <annotation-driven /> tags?

Some days ago I began to study this Spring Hello World Tutorial: http://viralpatel.net/blogs/spring-3-mvc-create-hello-world-application-spring-3-mvc/ In …

java spring spring-mvc annotations
spring autowiring with unique beans: Spring expected single matching bean but found 2

I am trying to autowire some beans (for dependency injection) using Spring for a webapp. One controller bean contains another …

spring spring-mvc dependency-injection annotations autowired
Get rid of "The value for annotation attribute must be a constant expression" message

I use annotation in my code, and I try to use value which determine in run time. I define my …

java annotations
annotation to make a private method public only for test classes

Who has a solution for that common need. I have a class in my application. some methods are public, as …

java unit-testing junit annotations
How to get annotations of a member variable?

I want to know a class's some member variable's annotations , I use BeanInfo beanInfo = Introspector.getBeanInfo(User.class) to introspect …

java reflection annotations beaninfo
Init method in Spring Controller (annotation version)

I'm converting a controller to the newer annotation version. In the old version I used to specify the init method …

java spring annotations controller
@Value annotation type casting to Integer from String

I'm trying to cast the output of a value to an integer: @Value("${api.orders.pingFrequency}") private Integer pingFrequency; The …

java spring casting annotations property-placeholder
Does Spring @Transactional attribute work on a private method?

If I have a @Transactional -annotation on a private method in a Spring bean, does the annotation have any effect? …

java spring transactions annotations
Can't find @Nullable inside javax.annotation.*

I want use @Nullable annotation to eliminate NullPointerExceptions. I found some tutorials on the net, I noticed that this annotation …

java annotations nullpointerexception nullable null-pointer