forked from bmatthias/config-builder
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more flexible command line value description
Signed-off-by: Daniel Kraschewski <daniel.kraschewski@tngtech.com>
- Loading branch information
Daniel Kraschewski
committed
Nov 20, 2020
1 parent
45be5aa
commit 9f09fa6
Showing
7 changed files
with
76 additions
and
21 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
.../java/com/tngtech/configbuilder/annotation/valueextractor/CommandLineValueDescriptor.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,18 @@ | ||
package com.tngtech.configbuilder.annotation.valueextractor; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* This annotation is used to mark a method as description text supplier for command line options.<br> | ||
* The annotated method must be static and accept a single parameter, which is the longOpt name of a command line option.<br> | ||
* There may be at most one such method per class (or none at all).<br> | ||
* If a field is annotated with {@link com.tngtech.configbuilder.annotation.valueextractor.CommandLineValue} but has no description,<br> | ||
* then this method is called to generate the description text.<br> | ||
* <b>Usage:</b> <code>@CommandLineValueDescriptor</code> | ||
*/ | ||
@Target(ElementType.METHOD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface CommandLineValueDescriptor {} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/tngtech/configbuilder/exception/InvalidDescriptionMethodException.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,3 @@ | ||
package com.tngtech.configbuilder.exception; | ||
|
||
public class InvalidDescriptionMethodException extends RuntimeException {} |
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
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