This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
256 additions
and
110 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,39 +1,35 @@ | ||
package example; | ||
|
||
import net.krlite.plumeconfig.annotation.Category; | ||
import net.krlite.plumeconfig.annotation.Comment; | ||
import net.krlite.plumeconfig.annotation.Option; | ||
|
||
import java.awt.*; | ||
|
||
public class Example { | ||
// This is an integer comment | ||
public @Comment int comment = 1; | ||
public @Comment int comment = 1; // Integer comment | ||
|
||
// This is a string comment | ||
public @Comment String comment2 = "comment2"; | ||
public @Comment String comment2 = "comment2\ncommented line"; // Multi-line comment | ||
|
||
// This is a string option | ||
@Option(name = "String", comment = "A String Comment") | ||
public String s = "string"; | ||
@Option(name = "String", comment = "A String\n Comment") | ||
@Category("abc") | ||
public String s = "string"; // A String option named "String" with a comment(line breaks will be ignored) | ||
|
||
// This is an integer option | ||
@Option(key = "integer", name = "Int") | ||
@Option(key = "integer", name = "Int") // An Integer option named "Int" with a specified key "integer" | ||
public int i = 1; | ||
|
||
// This is a string comment | ||
private final @Comment String comment3 = "comment3"; | ||
@Category("abc") | ||
private final @Comment String comment3 = "comment3"; // A comment in the category "abc" | ||
|
||
// This is a double option, but final, so cannot be changed | ||
private static final @Option double d = 1.0; | ||
@Category("abc") | ||
private static final @Option double d = 1.0; // A double option in the category "abc" | ||
|
||
// This is a regular field to not being read and written | ||
public static int silent = 1; | ||
public static int silent = 1; // No annotations, will be ignored | ||
|
||
public static int silent2 = 1; | ||
private static final int silent2 = 1; | ||
|
||
// This is a color option | ||
public static @Option Color color = Color.BLACK; | ||
@Category("def") | ||
public static @Option Color color = Color.BLACK; // A Color option in the category "def" | ||
|
||
// This is a boolean option | ||
public static @Option boolean bool; | ||
public static @Option boolean bool; // A boolean option | ||
} |
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
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 |
---|---|---|
@@ -1,8 +1,13 @@ | ||
# 1 | ||
# comment2 | ||
s = "string" # String | A String Comment | ||
# commented line | ||
integer = 1 # Int | ||
bool = false | ||
|
||
[abc] | ||
s = "string" # String | A String Comment | ||
# comment3 | ||
d = 1.0 | ||
color = 0xff000000 | ||
bool = false | ||
|
||
[def] | ||
color = 0xff000000 |
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 @@ | ||
# 1 | ||
# comment2 | ||
# commented line | ||
integer = 1 # Int | ||
bool = false | ||
[abc] | ||
s = "string" # String | A String Comment | ||
[abc] | ||
# comment3 | ||
[abc] | ||
d = 1.0 | ||
[def] | ||
color = 0xff000000 |
This file was deleted.
Oops, something went wrong.
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
12 changes: 12 additions & 0 deletions
12
src/main/java/net/krlite/plumeconfig/annotation/Category.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,12 @@ | ||
package net.krlite.plumeconfig.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target(ElementType.FIELD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface Category { | ||
String value(); | ||
} |
Oops, something went wrong.