Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
52 views

How do I get the evaluated value from a StaticAnnotation's member?

So I have an annotation that looks like this: class FakeAnnotation(val strings: String*) extends StaticAnnotation val someVar = "Test" @FakeAnnotation(someVar) class TestClass I can't see ...
Tanin's user avatar
  • 1,933
1 vote
1 answer
49 views

Dynamic struct field enumeration and attribute parsing in go

I am trying to create custom attribute tags for my go program. These tags will be used with fields, that will pull their values from vault, for e.g. Password string \vault:"password"``. The ...
Sýkora Jakub's user avatar
4 votes
3 answers
249 views

Why are Checker Framework annotations not returned by Field#getDeclaredAnnotations?

I wanted to extend a bit of code that processes annotations to also support the Nullable annotation from the Checker Framework. To my surprise, this didn't work. Upon further inspection, it seems like ...
knittl's user avatar
  • 267k
0 votes
0 answers
25 views

I was trying to make reflection using custom annotation

i was trying to make reflection using custom annotation and then this exception appeared. so need help regarding this issue,thanks in advance public class AnnotationTest { public static void ...
Khaled Osama's user avatar
0 votes
1 answer
84 views

Replace (annotated methods/methods which meet condition) on compile-time in Java

I can imagine this is bad practice, but this is purely for a private project and as an exercise for myself. I have a Class, which has a lot different static methods. They are used to test some stuff ...
gXLg's user avatar
  • 304
0 votes
0 answers
125 views

Issue processing annotations in Composable functions on Android with Kotlin

I'm having trouble processing annotations in Composable functions on my Android project. My goal is to add a custom annotation, let's say @CustomComponent, to my Composable functions and then be able ...
Juan Fraga's user avatar
0 votes
0 answers
65 views

How to modify an annotation attribute before Java compile time?

I have the following structure in my class public class ExampleResponseGenerator extends CustomAbstractClass { @Override @ConfigurableAnnotation( name = "...
EugenSunic's user avatar
  • 13.7k
0 votes
1 answer
68 views

List properties and types of a class

Is there a way in TypeScript, maybe a post-processor, transformer, reflection API or annotation system to get the properties of a class and the types of the property, like Python's __annotations__? ...
Felipe Buccioni's user avatar
1 vote
0 answers
532 views

Why does the reflections library not work in a Spring Boot application?

I'm using org.reflections:reflections to find annotated classes on the classpath within a Spring Boot application. When running the app from the IDE, everything works fine. But when I build the FAT-...
Yannick's user avatar
  • 119
0 votes
1 answer
402 views

Named fields for another class

I need to access some private fields via reflection. While this is considered bad, it is an external library and I have no other way to access it. The field names (and types) are known in advance (...
Marc's user avatar
  • 33
-1 votes
1 answer
64 views

Reflection not working as expected - NoSuchMethodException

I try to get statistics on method execution using an annotation on my code. Here is the code for the annotation: import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import ...
clincks's user avatar
1 vote
1 answer
79 views

Restrict usage of annotations in Scala

Given a custom defined annotation class GreaterThan(m: Double) extends scala.annotation.StaticAnnotation and a case class case class Person(name: String, @GreaterThan(0) age: Double), how can make ...
outlaw's user avatar
  • 241
1 vote
0 answers
208 views

Unable to get java annotation on kotlin method using reflection

I declare a java annotation. @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Inherited public @interface JavaAnnotation{} I use this java annotation in kotlin interface Problem.kt ...
Captain_spack_jarrow's user avatar
0 votes
0 answers
97 views

I want annotation that runs after method call itself according to return type in PHP

For example I have method that has boolean return type. I need a annotation or structure which it runs if method return true in PHP. Key point is I need separate the concerns, I don't want write this ...
Ahmet Deniz GÜNER's user avatar
0 votes
0 answers
649 views

Problems in changing value of a runtime annotation with reflection (Java 17)

I'm stuck into trying to change the value of a @Retention(RetentionPolicy.RUNTIME) annotation with Java 17. I think my code has some problems also related to the Java 9 illegal reflective access. That'...
renvins's user avatar
  • 33

15 30 50 per page
1
2 3 4 5
34