How to create an instance of an annotation

前端 未结 8 1279
无人及你
无人及你 2021-01-30 12:47

I am trying to do some Java annotation magic. I must say I am still catching up on annotation tricks and that certain things are still not quite clear to me.

So... I hav

8条回答
  •  萌比男神i
    2021-01-30 13:13

    @Gunnar's answer is the simplest way for most webservice as we already got hibernate, for example KafkaListener kafkaListener = new org.hibernate.validator.internal.util.annotation.AnnotationDescriptor.Builder<>(KafkaListener.class, ImmutableMap.of("topics", new String[]{"my-topic"})).build().getAnnotation(); and all other properties will stay default.

提交回复
热议问题