mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-12 15:56:00 +08:00
Added BooleanProvider#hidden
This commit is contained in:
parent
60f5571e42
commit
2b620f97f1
@ -79,6 +79,13 @@ public @interface BooleanProvider {
|
|||||||
*/
|
*/
|
||||||
String conditionName() default "";
|
String conditionName() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should the result of this method be hidden from the user.
|
||||||
|
*
|
||||||
|
* @return true if the value should not be displayed on the page.
|
||||||
|
*/
|
||||||
|
boolean hidden() default false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of Font Awesome icon.
|
* Name of Font Awesome icon.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -181,6 +181,10 @@ public final class ExtensionExtractor {
|
|||||||
if (annotation.conditionName().equals(condition)) {
|
if (annotation.conditionName().equals(condition)) {
|
||||||
warnings.add(extensionName + "." + method.getName() + " can not be conditional of itself. required condition: " + condition + ", provided condition: " + annotation.conditionName());
|
warnings.add(extensionName + "." + method.getName() + " can not be conditional of itself. required condition: " + condition + ", provided condition: " + annotation.conditionName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (annotation.conditionName().isEmpty() && annotation.hidden()) {
|
||||||
|
throw new IllegalArgumentException(extensionName + "." + method.getName() + " can not be 'hidden' without a 'conditionName'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user