Class DatapathUtil


  • public class DatapathUtil
    extends Object
    The utility class for a data path object
    • Constructor Detail

      • DatapathUtil

        public DatapathUtil()
    • Method Detail

      • isEqualDataPath

        public static boolean isEqualDataPath​(AbstractDataPath path1,
                                              AbstractDataPath path2)
        Compares two AbstractDataPath object each other. The result is true if and only if they represents the same sequence of segments.
        Parameters:
        path1 - - a first path
        path2 - - a second path
        Returns:
        true if the given paths represents the same sequence of segments, false otherwise.
        Throws:
        NullPointerException - in case one from the specified paths is null
      • isEqualDataPath

        public static boolean isEqualDataPath​(AbstractFormDataSourceInfo info1,
                                              AbstractFormDataSourceInfo info2)
        Compares two AbstractFormDataSource#getDataPath(ScriptVariant) object each other.
        Parameters:
        info1 - the first property info
        info2 - the second property info
        Returns:
        true if the given paths represents the same sequence of segments, false otherwise.
        Throws:
        NullPointerException - in case one from the specified paths is null
      • startsWith

        public static boolean startsWith​(AbstractDataPath verifiable,
                                         AbstractDataPath prefix)
        Tests if the verifiable data path starts with the specified prefix data path.
        Parameters:
        verifiable - the verifiable
        prefix - the prefix
        Returns:
        true if the verifiable data path starts with a prefix data path; false otherwise.
      • isElementDataPath

        public static boolean isElementDataPath​(AbstractDataPath path)
        Checks the data path is a data path of form element
        Parameters:
        path - the data path
        Returns:
        return true if is data path of form element.
      • hasIndex

        public static boolean hasIndex​(AbstractDataPath path)
        The method checks a AbstractDataPath contains indexes data
        Parameters:
        path - the checking path
        Returns:
        true if path contains any indexes data; false the otherways
      • getIndexForSegment

        public static Integer[] getIndexForSegment​(AbstractDataPath path)
        Gets indexes data for segments
        Parameters:
        path - the path for gets indexes data
        Returns:
        returns the array with values of indexes for the corresponding segments. Length of returning array equals size of path segments. If segments not contains index then array value equals null
      • setIndexForSegment

        public static void setIndexForSegment​(AbstractDataPath path,
                                              Integer[] indexes)
        Sets indexes data for segments of the data path

        Important: the indexes will be set to current data path, do not forget using the copy data path.

        Parameters:
        path - the data path to which it will be set indexes.
        indexes - the setting indexes
        See Also:
        EcoreUtil.copy(org.eclipse.emf.ecore.EObject)