com.ctrip.framework.apollo.spring.annotation.ApolloConfig Maven / Gradle / Ivy
The newest version!
package com.ctrip.framework.apollo.spring.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.ctrip.framework.apollo.core.ConfigConsts;
/**
* Use this annotation to inject Apollo Config Instance.
*
* Usage example:
*
* //Inject the config for "someNamespace"
* @ApolloConfig("someNamespace")
* private Config config;
*
*
* @author Jason Song([email protected])
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Documented
public @interface ApolloConfig {
/**
* Apollo namespace for the config, if not specified then default to application
*/
String value() default ConfigConsts.NAMESPACE_APPLICATION;
}