final class AutoConf extends Annotation with ConfiguratorAnnotation
Inject parameter from configuration.
The config path is derived automatically from the context.
For example, given a class:
class Service(@AutoConf hostPort: HostPort)
where:
case class HostPort(host: String, port: Int)
you'll be able to define configuration like this:
Service { HostPort { host = "example.com" port = 8080 } }
If the requesting class is bound as named binding, you can disambiguate the config path to uniquely configure that class:
new ModuleDef { make[Service].named("namedService") }
Config:
Service { namedService { HostPort { host = "example.com" port = 8080 } } }
If a class requests several values of the same type from config, you can disambiguate the config path using parameter names:
class Service(@AutoConf param1: HostPort, @AutoConf param2: HostPort)
Config:
Service { HostPort { param1 { host = "example.com" port = 8080 } param2 { host = "google.com" port = 80 } } }
Specifically, the path is defined by segments:
{binding_type}.{binding_id_key?}.{config_type}.{parameter_name?}
Where segments marked with ? at the end are optional.
Use this annotation when you need to inject one config section into one component
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- AutoConf
- ConfiguratorAnnotation
- DIStageAnnotation
- StaticAnnotation
- Annotation
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
- new AutoConf()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.