1. Domino Brix
  2. Codegen & annotations

Key annotations

  • @BrixPresenter – generate presenter impl and lifecycle wiring.
  • @UiView – generate a _UiView subclass and DI bindings.
  • @BrixComponent – generate component initializer for router registration.
  • @BrixRoute – map presenter to a route; supports custom routing provider.
  • @BrixSlot / @RegisterSlots – declare and supply slots.
  • @ListenFor, @PathParameter, @QueryParameter, @FragmentParameter – wire events and routing state.
  • Lifecycle annotations: @OnReveal, @OnBeforeReveal, @OnActivated, @OnDeactivated, @OnStateChanged, @OnRemove.
  • Handlers: @UiHandler on presenter methods, @Handlers on view fields.
  • Qualifiers: @BrixTask for startup tasks, @Global for shared core beans.

Minimal example

			@BrixPresenter
@BrixRoute("todos")
@BrixSlot(BrixSlots.BRIX_BODY_SLOT)
@BrixComponent(presenter = TodosPresenter.class)
public class TodosPresenter extends Presenter<TodosView> {

  @PathParameter("id") String todoId;

  @ListenFor(TodoCreated.class)
  void onTodoCreated(TodoCreated event) { view.add(event.todo()); }

  @Override
  protected void onRevealed() {
    view.show(todoId);
  }
}

@UiView
public class TodosView extends BrixView<Element, TodosHandlers>
    implements TodosPresenter.TodosView {
  @Handlers TodosHandlers handlers;
  public void show(String id) { /* ... */ }
}

		

What gets generated

  • *PresenterImpl: lifecycle hooks, routing parameter mapping, event/handler wiring.
  • *_UiView: handler injection and Dagger bindings.
  • *Routing: token filters for the router.
  • BrixComponentInitializer: service entry in META-INF/services for router registration.

We are a group of passionate people who love what we do

Donate & Support Us