Class UiComponentPolicyUtils
java.lang.Object
io.jmix.uiconstraints.policy.utils.UiComponentPolicyUtils
Utility class for handling UI component policy strings. Provides methods to build resource strings and extract view
and component IDs from resource strings.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Regular expression to validate the format of the resource string. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
buildResourceString
(String viewId, String componentId) Builds a resource string from the given view ID and component ID.static String
extractComponentId
(String resource) Extracts the component ID from the given resource string.static String
extractViewId
(String resource) Extracts the view ID from the given resource string.
-
Field Details
-
UI_COMPONENT_POLICY_RESOURCE_REGEX
Regular expression to validate the format of the resource string. Expected format: [viewId]componentId- See Also:
-
-
Constructor Details
-
UiComponentPolicyUtils
public UiComponentPolicyUtils()
-
-
Method Details
-
buildResourceString
Builds a resource string from the given view ID and component ID.- Parameters:
viewId
- the ID of the viewcomponentId
- the ID of the component- Returns:
- the resource string in the format [viewId]componentId
-
extractViewId
Extracts the view ID from the given resource string.- Parameters:
resource
- the resource string in the format [viewId]componentId- Returns:
- the extracted view ID
- Throws:
IllegalArgumentException
- if the resource string format is invalid
-
extractComponentId
Extracts the component ID from the given resource string.- Parameters:
resource
- the resource string in the format [viewId]componentId- Returns:
- the extracted component ID
- Throws:
IllegalArgumentException
- if the resource string format is invalid
-