Document Latest Features in README #27
54
README.md
54
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
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>dev.kske</groupId>
|
||||
<artifactId>event-bus-core</artifactId>
|
||||
<version>1.1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
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;
|
||||
kske marked this conversation as resolved
Outdated
|
||||
```
|
||||
|
||||
## 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
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>dev.kske</groupId>
|
||||
<artifactId>event-bus-core</artifactId>
|
||||
<version>1.1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user
opens
works for modules as well?I thought it should have been
opens my.package to dev.kske.eventbus.core
...This seems to be wrong actually. I will change it accordingly.