Packages

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
ConfiguratorAnnotation, DIStageAnnotation, StaticAnnotation, Annotation, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AutoConf
  2. ConfiguratorAnnotation
  3. DIStageAnnotation
  4. StaticAnnotation
  5. Annotation
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AutoConf()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. 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.

Inherited from ConfiguratorAnnotation

Inherited from DIStageAnnotation

Inherited from StaticAnnotation

Inherited from Annotation

Inherited from AnyRef

Inherited from Any

Ungrouped