Skip to content

Annotation processor options

Stéphane Nicolas edited this page Jul 17, 2019 · 10 revisions

Toothpick annotations processors uses the following annotation processor options.

toothpick_excludes

This option can be used to exclude classes for which a MemberInjector or a Factory should be created.

Excludes are defined using java regular expressions, comma separated.

Example : -Atoothpick_excludes="java.*,android.*" (default value)

toothpick_annotations

This option can be used to let Toothpick know about custom scope annotation classes.

This way, factories can be created for the classes annotated with these custom annotations without the need of containing any @Inject annotated members or constructors. The same way it happens for @Singleton and @ProvidesSingleton.

If you use custom scope annotations, it is a good practice to always use this option so that developers can use the new scope annotation in a very free way without having to consider the annotation processing internals.

Custom scope annotations are expressed as a comma separated list.

Example : -Atoothpick_annotations="com.bar.ActivityScope,com.bar.PresenterScope

The options bellow only apply to TP 1.X. TP 2 & 3 do not use registries anymore.

toothpick_registry_package_name

This option indicates to Toothpick in which package both Factory & Member Injectors Registries should be generated when compiling a given compilation unit.

It can be useful, when using registries instead of reflection (see Configurations for more details).

Example : -Atoothpick_registry_package_name="com.foo"

toothpick_registry_children_package_names

This option indicates to Toothpick in which package(s) are located the children registries of a given compilation unit. When creating a Factory & Member Injectors Registries for a given compilation unit, both of them can use children registries. This option indicates where to find them.

It can be useful, when using registries instead of reflection (see Configurations for more details).

Children registries packages are expressed as a comma separated list of package names.

Example : -Atoothpick_registry_children_package_names="com.bar,com.baz"