-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added @ModuleInstance annotation. Annotate a static field inside your…
… module class to have it populated with its instance, allowing for easy singleton patterns. This is opt in
- Loading branch information
1 parent
ccac3d9
commit 832410e
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/java/org/violetmoon/zeta/module/ModuleInstance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.violetmoon.zeta.module; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
// populates a public static field in your module class with the module instance. Needs to be inside a @ZetaLoadModule class | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.FIELD) | ||
public @interface ModuleInstance { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters