Skip to content

Commit

Permalink
add injection prototype (#140)
Browse files Browse the repository at this point in the history
* add injection prototype
  • Loading branch information
Emily-Jiang authored Dec 1, 2022
1 parent b519d15 commit 0c37546
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions spec/src/main/asciidoc/02-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,28 @@
== Introduction


== Support Injection
A ConfigMapping interface can be injected via the `@Inject`. The following example demonstrates the usage.

[source]
----
customer.name=Bob
customer.age=28
----

[Usage example]

The following is a usage example for how `@Inject` may be used:

[source, java]
----
@ConfigMapping("customer")
public interface MyConfigMapping{
String name;
int age;
}
@Inject MyConfigMapping myConfigMapping;
----

In the above example, the values for `myConfigMapping.name` for `myConfigMapping.age` will be `Bob`, `28` correspondingly.

0 comments on commit 0c37546

Please sign in to comment.