From 3fccb809c8f8c5d17fb20c92ac1a7f608cdbdbb5 Mon Sep 17 00:00:00 2001 From: kske Date: Wed, 24 Nov 2021 10:49:30 +0100 Subject: [PATCH] Move installation section up in README --- README.md | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index e05d890..493d672 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,33 @@ private static void onSimpleEvent(SimpleEvent event) { ... } is technically possible, however you would still have to create an instance of the event listener to register it at an event bus. +## Installation + +Event Bus is available in Maven Central. +To include it inside your project, just add the following dependency to your `pom.xml`: + +```xml + + + dev.kske + event-bus-core + 1.1.0 + + +``` + +Then, require the Event Bus Core module in your `module-info.java`: + +```java +requires dev.kske.eventbus.core; +``` + +If you intend to use event handlers that are inaccessible to Event Bus by means of Java language access control, make sure to allow reflective access from your module: + +```java +opens my.module to dev.kske.eventbus.core; +``` + ## Polymorphic Event Handlers On certain occasions it's practical for an event handler to accept both events of the specified type, as well as subclasses of that event. @@ -182,33 +209,6 @@ System.out.println(EventBus.getInstance().printExecutionOrder(SimpleEvent.class) Then, the execution order can be inspected in the console. -## Installation - -Event Bus is available in Maven Central. -To include it inside your project, just add the following dependency to your `pom.xml`: - -```xml - - - dev.kske - event-bus-core - 1.1.0 - - -``` - -Then, require the Event Bus Core module in your `module-info.java`: - -```java -requires dev.kske.eventbus.core; -``` - -If you intend to use event handlers that are inaccessible to Event Bus by means of Java language access control, make sure to allow reflective access from your module: - -```java -opens my.module to dev.kske.eventbus.core; -``` - ## Compile-Time Error Checking with Event Bus Proc To assist you with writing event listeners, the Event Bus Proc (Annotation Processor) module enforces correct usage of the `@Event` annotation during compile time.