2

I have a simple custom annotation:

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Service
public @interface SampleDefinition {
    String description();
    String orderNr() default "";
}

I need to make a description() configurable which means I need something like:

@SampleDefinition(description = "Value from properties ${expirationDays:120}")

I know I cannot use SpEL just like I did in the example. However, is there a way to inject Spring property value into this description?

Adam
  • 884
  • 7
  • 29

0 Answers0