Questions tagged [java-annotations]

211 questions
4
votes
1 answer

Extend class level RequestMapping with custom annotation

I would like to create a custom annotation in my Spring Boot application which always adds a prefix to my class level RequestMapping path. My Controller: import com.sagemcom.smartvillage.smartvision.common.MyApi; import…
Csuki
  • 1,297
  • 8
  • 21
4
votes
1 answer

Gradle annotationProcessor for JOOQ checker

Does Gradle have an equivalent to the Maven configuration described for the JOOQ type checker annotation processors (https://www.jooq.org/doc/latest/manual/tools/checker-framework/)? The Maven version is: org.jooq
Gabor Angeli
  • 5,729
  • 1
  • 18
  • 29
4
votes
3 answers

"invalid use of @throws" compile error when having log4j-core in classpath

We started getting this error on our tests about a week ago. It has been on and off - sometimes people will get it and other times they won't. /.../product/integration/src/test/java/com/acme/integration/code/CodeTestUtils.java:74: error: invalid use…
Hakanai
  • 12,010
  • 10
  • 62
  • 132
4
votes
2 answers

Can annotations limit the characters of a class field in java?

I'm using java 1.8, Spring Boot and MongoDb to store some data in database to learn about mongoDb I want to limit the characters of a class fields through annotations i tried to control this with hibernate-validator: import…
MaQuiNa1995
  • 431
  • 1
  • 9
  • 23
4
votes
7 answers

Remove @Override annotation error in Java8

I created the following interface with a single method: public interface Greeting { public void perform(); } I was trying to pass an instance of the interface to the greet() method. public class Greeter { public void greet(Greeting…
4
votes
1 answer

Annotation processing with kapt Android Studio

I'm trying to use kapt for using my annotation processor. But I ran into a few problems. Annotation processor jar is connected this way: kapt files('libs/processor.jar') provided files('libs/processor.jar') 1) I'm using JavaPoet for code…
Ufkoku
  • 2,384
  • 20
  • 44
4
votes
1 answer

How to make if-else statement in JAPE right hand side?

I am new to JAPE (Java Annotation Pattern Engine), a part of GATE. I have already made some rules in LHS that result some tags (say tag a, b, and c) in text. My text consists of several parts, and I would like to classify each part based on…
A. U.
  • 67
  • 5
3
votes
1 answer

How to add Java annotations to JNI SWIG API?

We are using SWIG to create the JNI API between C++ API to Java in Android. So for example lets say that our C++ class is: class TestAnnotation { public: void setMessage(char * message); char * getMessage(); private: char* message =…
Doron Yakovlev Golani
  • 5,188
  • 9
  • 36
  • 60
3
votes
1 answer

Is there a way to make a specific Java annotation mandatory in subclasses of a specific class

I am not a super expert in Java annotations, and I wanted to find out if there is a way to make sure that given a subclass of a specific class, the subclass must use a specific Java annotation on the class definition itself or the code won't…
3
votes
2 answers

Trying to debug Annotation Processor in android studio end up getting exception

Using Android Studio 3.1.3 gradle 3.1.2 Runnung Remote build with default config with 5005 port and in gradle.properties file org.gradle.daemon=false org.gradle.jvmargs= -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 always…
3
votes
3 answers

Why JPA Transient annotation have method in Target?

Can anyone explain using an example as to why the @Transient annotation in JPA has @Target method as well? I am referring to documentation http://docs.oracle.com/javaee/5/api/javax/persistence/Transient.html @Target(value={METHOD,FIELD}) Thanks in…
3
votes
1 answer

Using annotations with Apache Olingo for OData v4

I see there is documentation that describes using annotations with Olingo for Odata v2: https://olingo.apache.org/doc/odata2/tutorials/AnnotationProcessorExtension.html So for example, instead of manually creating a provider that details all the EDM…
Mike
  • 791
  • 8
  • 18
3
votes
0 answers

Custom annotation in TestNG Report for selenium Testing

I have been using selenium webdriver to automate AUT. Unfortunately our system has lot of known bugs and Product is ok with them but the real problem is those test cases will fail in TestNG report and management will get a big list of failed…
Deepu Nair
  • 165
  • 5
  • 15
2
votes
0 answers

Alias for kotlin @Interface

I'm using in my project AndroidFindByChainSet annotation many times which looks like: @Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface AndroidFindByChainSet { AndroidFindBys[] value(); } Is it…
falsetto
  • 789
  • 2
  • 11
  • 35
2
votes
0 answers

The benefits of upgrading form swagger 1.5 to 2 or 3

I am working on a project that is using java annotations for swagger 1.5. We are looking at improving the information in our documentation i.e. is it correct and can we make it better. In researching this I see swagger 2 and 3 are available now. In…
Ralph57
  • 21
  • 1
1 2
3
14 15