Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/en/guide/plugins/addingMethodsAtCompileTime.adoc
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ class ControllerTraitInjector implements TraitInjector {
@Override
Class getTrait() {
DateTrait
SomeTrait
}
@Override
@@ -35,7 +35,7 @@ class ControllerTraitInjector implements TraitInjector {
}
----

The above `TraitInjector` will add the `DateTrait` to all controllers. The `getArtefactTypes` method defines the types of artefacts that the trait should be applied to.
The above `TraitInjector` will add the `SomeTrait` to all controllers. The `getArtefactTypes` method defines the types of artefacts that the trait should be applied to.

The framework discovers trait injectors by way of a `META-INF/grails.factories` descriptor that is in the .jar file. This descriptor is automatically generated. The descriptor generated for the code shown above would look like this:

0 comments on commit d30ebc2

Please sign in to comment.