Questions tagged [java-annotations]
211 questions
0
votes
0 answers
Is it possible to get super class constructor arguments during annotations processing?
Can I get Problemes.NO from
: Memes(Problemes.NO) during annotations processing somehow?
sealed class Memes(val pr: Problemes) {
enum class Problemes { NO }
↓↓↓
data class Foo(val moo: String)…

PilotOfSparrow
- 3
- 2
0
votes
1 answer
Where are the rules for annotation classes written for java
I am trying to understand how the annotation understands what to do when we use the annotation. I am not talking about the behaviors like when to execute
that is covered by Retention, values etc. I want to understand how annotations understand the…

Rohith Joseph
- 603
- 1
- 5
- 17
0
votes
1 answer
How to use an Event Hub Trigger in a Java Azure Function
I am attempting to create a Java Azure Function that triggers off of an Azure Event Hub. I am following these code snippets: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-hubs-trigger?tabs=java#example
Here is my…

Rhett Prestwich
- 48
- 6
0
votes
1 answer
How to apply DynamoDB Bean annotations to a different project's POJOs by using generics?
I'm trying to setup a micro-framework within my application to remove duplication of code ("DRY" principle). Specifically I have a need to use annotations from my project in conjunction with several POJO classes that are in a different project…

Alex R
- 11,364
- 15
- 100
- 180
0
votes
1 answer
NoUniqueBeanDefinitionException: No qualifying bean of type 'AppProperties' available: expected single matching bean but found 3
I am trying to load the api key value from the application.properties file and below are the class files. I am unable to start the application as it is not able to find the unique bean. Not sure what i am missing. Can someone please help.
This is…

kumar r
- 1
- 1
0
votes
1 answer
Why is it OK to only use brackets for annotation array argument, but not for method parameter?
OK, so there's something that bothers me a little in the Java syntax that I don't quite understand.
When an annotation accepts an array as one of its argument's value, we can do so by providing the values inside a couple of brackets, like so:
public…

Tazaf
- 350
- 5
- 15
0
votes
1 answer
How can I get a generic type annotation
Please tell me, how can I get annotations for a generic type?
Example: I have public List<@NotNull GuestForm> guests and I want to get NotNull annotation.
public class BookingForm {
public List<@NotNull GuestForm> guests;
private…

Andrey Romanyuk
- 31
- 1
- 4
0
votes
1 answer
implement custom annotation in spring boot environment
I want to create and implement annotation in spring boot environment
Get cookie value through HttpServletRequest to get UserDto from some service
And I want to insert it through the annotation below (@UserInfo), but I don't know how to access…

mong
- 1
- 1
0
votes
1 answer
Java custom annotation on class as field (HAS-A relation)
Requirement - validate input as alpha numeric.
I have two class are in Has-A relation
Quick help appreciate, thanks in advance.
public class Party {
@InputContraint
private String firstName;
@InputContraint
private String lastName;
…

Yugandhar Gali
- 29
- 9
0
votes
1 answer
Custom annotation on model field to encrypt and decrypt while storing to DB in spring boot
I have a spring boot application and am a beginner with custom annotation. I want to introduce a custom annotation simillar to couchbase java sdk's @EncryptedField.
If I apply that annotation to a field in the model class, then that field has to be…

vijayashankard
- 721
- 1
- 7
- 23
0
votes
0 answers
Stripping internal annotation
I have an Android library module where a public class uses some annotations from an external library. The annotations are purely used internally, so I don't want to expose it as an API Gradle dependency, leaking that dependency to clients, but keep…

JHH
- 8,567
- 8
- 47
- 91
0
votes
1 answer
Can we self-generate a client out of a Rest controller using annotation processing ? If we can then how I can proceed?
(https://github.com/aashrai/brahma-dao), similar to this DAO generator can we do annotation processing to generate a client for a rest controller ?
PS : I am using Spring Boot with gradle.

Piyush Pant
- 35
- 1
- 6
0
votes
1 answer
Make custom forms with annotations in Java
I'm trying to make custom forms with annotations. My idea is that given an annotated class, my code could generate a FX GUI form to edit objects of that class. It should be clearer in the code:
@...
@interface Form {
String label() default…

LBald
- 473
- 2
- 11
0
votes
1 answer
How to declare a generic Class extending an annotation
I'm working on an annotation processor and I would pass to my class a parameter representing the annotation to manage, something like: Class extends @interface> annotationClass
Unfortunately this does not compile. The only way I can compile is…

firegloves
- 5,581
- 2
- 29
- 50
0
votes
0 answers
How to modify the body of a method using AbstractProcessor in Java?
Longtime reader, first time poster here. I have been working on a project which requires me to use an annotation processor. I know that what I am doing is covered by AspectJ but unfortunately AspectJ requires using the AJC compiler and this causes…