Skip to main content

Questions tagged [annotations]

8 votes
2 answers
1k views

In terms of deprecation strategies, we can mark a value as deprecated and this can imply that 'this thing exists now and should work, but in future major releases this thing may disappear and will ...
dwjohnston's user avatar
  • 2,769
7 votes
1 answer
3k views

Goal: I am trying to create a UML class diagram for a java spring application. Spring uses a lot of annotations and I couldn't find any resources online on how to properly model them in UML. I know ...
Tim Engbrocks's user avatar
1 vote
1 answer
193 views

What were the motivations for java to use the @FunctionalInterface annotation, instead of creating a new FunctionalInterface modifier? @FunctionalInterface public interface MyFunction { TypeB ...
aminator's user avatar
  • 123
1 vote
1 answer
350 views

I am writing an android app. Some of its functionalities require the user to be authenticated. I am planning to create an annotation like this: @RequiresAuth fun commentOnTask(){ .... } This ...
Nurseyit Tursunkulov's user avatar
4 votes
2 answers
2k views

If one wants to comply with the clean architecture principle 100%, they must not annotate the entities in the entities layer with database-specific annotations (like Hibernate, Neo4j, etc.). So, two ...
Shayan's user avatar
  • 209
0 votes
1 answer
1k views

I have a Java EE Application in which I have an Interceptor class like this @Interceptor @Logged public class LogInterceptor { @AroundInvoke public Object logMethod(InvocationContext context) ...
a e s t h e t i c's user avatar
2 votes
0 answers
239 views

When I first a codebase, I frequently take notes about it, as this SO answer suggests. If some code chunk is small enough, I copy-paste to Word, print it out, and make hand-written annotation. If the ...
Heisenberg's user avatar
5 votes
0 answers
256 views

So compile-time annotation processing is as old as the annotations themselves in Java. Yet most of the useful libraries were developed with the runtime approach in mind – at least at first. Now, ...
Michal M's user avatar
  • 159
2 votes
1 answer
159 views

Assume I have these classes: @Entity @Data class Student{ @Size(min = 8) public String name; public int age; ... } @Data class StudentDTO{ @Size(min = 8) public String name; ...
cdxf's user avatar
  • 151
6 votes
1 answer
2k views

I understand that Annotations aren't directly used in compiled Java programs outside of access through the reflection API or some other means. Annotations, a form of metadata, provide data about a ...
ha9u63a7's user avatar
  • 397
0 votes
1 answer
98 views

I have a set of annotations which are used for tracking failures/success of a function. Now, there is a class A which has a function f(). This function needs to be invoked for different business use-...
Anshul Jain's user avatar
1 vote
2 answers
108 views

Below are the relevant types(in java) for annotation processing, In addition to Field & Method types, Package type is also used in context of annotations with reflection, because these types ...
user1787812's user avatar
0 votes
2 answers
7k views

In a project, I have a task scheduling service, which is allowed to execute certain public methods from other services. Each service decides itself, which methods it want to make available for the ...
Herr Derb's user avatar
  • 439
1 vote
1 answer
1k views

There is that @Deprecated annotation which suits well for Java libraries. A minor release change would not break an existing code if a deprecated library method remains. The library compilation will ...
KoichiSenada's user avatar
8 votes
2 answers
385 views

With Doctrine annotation processing engine for PHP, and Annotatons being used for Doctrine Entities and for Zend Form, and possibly other things, and use in other languages as well, it looks like ...
Dennis's user avatar
  • 8,267

15 30 50 per page