Class UiComponentPolicyUtils

java.lang.Object
io.jmix.uiconstraints.policy.utils.UiComponentPolicyUtils

public class UiComponentPolicyUtils extends Object
Utility class for handling UI component policy strings. Provides methods to build resource strings and extract view and component IDs from resource strings.
  • Field Details

    • UI_COMPONENT_POLICY_RESOURCE_REGEX

      public static final String 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

      public static String buildResourceString(String viewId, String componentId)
      Builds a resource string from the given view ID and component ID.
      Parameters:
      viewId - the ID of the view
      componentId - the ID of the component
      Returns:
      the resource string in the format [viewId]componentId
    • extractViewId

      public static String extractViewId(String resource)
      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

      public static String extractComponentId(String resource)
      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