mixinafIocConfig::ConfigClass

afIocConfig::ConfigClass

@Js

A utility mixin that simply logs injected config on startup. Because sometimes it's nice to see what your app is using! Example:

using afIocConfig

const class AppConfig : ConfigClass {
    @Config const Uri jdbcUrl
    @Config const Str username
    @Config const Str password
    @Config const Str messageOfTheDay

    new make(|This| f) { f(this) } 
}

Will print:

App Config
==========
Jdbc Url ......... : jdbc:wotever
Username ......... : knobs
Password ......... : secret
Message Of The Day : Eat moar ice-cream!
dump

Source

static Str dump(Obj configClass, Str? title := null, [Str:Obj]? extra := null)

Dumps @Config fields of the given configClass to a Str, appending any extra properties to the end.

Any key starting with --- is used as a separator.

Is static so it may be called from anywhere.

dumpFields

Source

static Str dumpFields(Obj configClass, Field[] fields, Str? title := null, [Str:Obj]? extra := null)

Dumps fields of the given configClass to a Str, appending any extra properties to the end.

Any key starting with --- is used as a separator.

Is static so it may be called from anywhere.

logConfig

Source

@PostInjection
virtual Void logConfig()

Logs the @Config fields to info.