sirius.kernel.di.std.ConfigValue Maven / Gradle / Ivy
Show all versions of sirius-kernel Show documentation
/*
* Made with all the love in the world
* by scireum in Remshalden, Germany
*
* Copyright by scireum GmbH
* http://www.scireum.de - [email protected]
*/
package sirius.kernel.di.std;
import sirius.kernel.Sirius;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Reads the config value given in value and inserts in into the field, wearing this annotation.
*
* Provides a shortcut for accessing the config ({@link Sirius#getSettings()}). Also it performs the
* appropriate conversion to the target type of the given field. A default value should be placed in the
* component config (which then can be overridden in the application.conf or instance.conf).
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ConfigValue {
/**
* Contains the dot separated path to the desired config value.
*
* @return the path for the value to fetch from the config
*/
String value();
/**
* Determines if the value is required (will cause an error if not filled).
*
* Basically this should not happen, as it is a good practice to place a default value in the current
* component config.
*
* @return true if the value must be filled, false (default) otherwise.
*/
boolean required() default false;
}