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
7 changed files
with
100 additions
and
35 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
12 changes: 7 additions & 5 deletions
12
src/main/java/net/krlite/plumeconfig/annotation/Comment.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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
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; | ||
import net.krlite.plumeconfig.io.LineBreak; | ||
|
||
@Target(ElementType.FIELD) | ||
import java.lang.annotation.*; | ||
|
||
@Target({ElementType.FIELD, ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Repeatable(Comments.class) | ||
public @interface Comment { | ||
String value() default ""; | ||
LineBreak newLine() default LineBreak.NONE; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/net/krlite/plumeconfig/annotation/Comments.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, ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface Comments { | ||
Comment[] value(); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.krlite.plumeconfig.io; | ||
|
||
public enum LineBreak { | ||
NONE(false, false), | ||
BEFORE(true, false), | ||
AFTER(false, true), | ||
BOTH(true, true); | ||
|
||
private final boolean before; | ||
private final boolean after; | ||
|
||
LineBreak(boolean before, boolean after) { | ||
this.before = before; | ||
this.after = after; | ||
} | ||
|
||
public boolean isBefore() { | ||
return before; | ||
} | ||
|
||
public boolean isAfter() { | ||
return after; | ||
} | ||
} |
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