Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This annotation allows us inject string properties
package com.javaee.injectprops.annotations;
import javax.enterprise.util.Nonbinding;
import javax.inject.Qualifier;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Qualifier
@Retention(RUNTIME)
@Target({FIELD, METHOD, PARAMETER})
public @interface StringProperty {
@Nonbinding public String value() default "";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment