Class AllowedPackageChecker
java.lang.Object
com.flowingcode.vaadin.addons.utils.checker.AllowedPackageChecker
Utilities for checking if a component's package is
allowed.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Component>
voidChecks that the component's package is allowed and displays an error message if the package name is not in the list.static <T extends Component>
voidChecks that the component's package is allowed and displays an error message if the package name is not in the list.
-
Method Details
-
check
Checks that the component's package is allowed and displays an error message if the package name is not in the list.The check is performed only in development mode for Spring Boot applications that have an allowed packages list. No check is done in production mode.
- Parameters:
component- the component instance to be checked.type- the type of the component to be checked.
-
check
public static <T extends Component> void check(T component, Class<? super T> type, String packageName) Checks that the component's package is allowed and displays an error message if the package name is not in the list.The check is performed only in development mode for Spring Boot applications that have an allowed packages list. No check is done in production mode.
The error message will reference
packageName.- Parameters:
component- the component instance to be checked.type- the type of the component to be checked.packageName- the package to report in the error message.- Throws:
NullPointerException- if any argument isnull.IllegalArgumentException- if the component's package does not match or is not a subpackage ofpackageName.
-