Package com._1c.g5.v8.dt.form.util
Class DatapathUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.form.util.DatapathUtil
-
public class DatapathUtil extends Object
The utility class for a data path object
-
-
Constructor Summary
Constructors Constructor Description DatapathUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AbstractDataPathgetDataPathForAutoTable(DataItem item)ReturnsTableHolder's parent path for auto-table which has no data path itself (e.g.static AbstractDataPathgetDataPathForCurrentScriptVariant(AbstractDataPath sourceDataPath, Form form, ScriptVariant scriptVariant, IDataSourceInfoAssociationService associationService)static Integer[]getIndexForSegment(AbstractDataPath path)Gets indexes data for segmentsstatic booleanhasIndex(AbstractDataPath path)The method checks aAbstractDataPathcontains indexes datastatic booleanisElementDataPath(AbstractDataPath path)Checks the data path is a data path of form elementstatic booleanisEqualDataPath(AbstractDataPath path1, AbstractDataPath path2)Compares twoAbstractDataPathobject each other.static booleanisEqualDataPath(AbstractFormDataSourceInfo info1, AbstractFormDataSourceInfo info2)Compares twoAbstractFormDataSource#getDataPath(ScriptVariant)object each other.static voidsetIndexForSegment(AbstractDataPath path, Integer[] indexes)Sets indexes data for segments of the data pathstatic booleanstartsWith(AbstractDataPath verifiable, AbstractDataPath prefix)Tests if the verifiable data path starts with the specified prefix data path.
-
-
-
Method Detail
-
isEqualDataPath
public static boolean isEqualDataPath(AbstractDataPath path1, AbstractDataPath path2)
Compares twoAbstractDataPathobject each other. The result istrueif and only if they represents the same sequence of segments.- Parameters:
path1- - a first pathpath2- - a second path- Returns:
trueif the given paths represents the same sequence of segments,falseotherwise.- Throws:
NullPointerException- in case one from the specified paths isnull
-
isEqualDataPath
public static boolean isEqualDataPath(AbstractFormDataSourceInfo info1, AbstractFormDataSourceInfo info2)
Compares twoAbstractFormDataSource#getDataPath(ScriptVariant)object each other.- Parameters:
info1- the first property infoinfo2- the second property info- Returns:
trueif the given paths represents the same sequence of segments,falseotherwise.- Throws:
NullPointerException- in case one from the specified paths isnull
-
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 verifiableprefix- the prefix- Returns:
trueif the verifiable data path starts with a prefix data path;falseotherwise.
-
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
trueif is data path of form element.
-
hasIndex
public static boolean hasIndex(AbstractDataPath path)
The method checks aAbstractDataPathcontains indexes data- Parameters:
path- the checking path- Returns:
trueif path contains any indexes data;falsethe 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 pathImportant: 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)
-
getDataPathForCurrentScriptVariant
public static AbstractDataPath getDataPathForCurrentScriptVariant(AbstractDataPath sourceDataPath, Form form, ScriptVariant scriptVariant, IDataSourceInfoAssociationService associationService)
-
getDataPathForAutoTable
public static AbstractDataPath getDataPathForAutoTable(DataItem item)
ReturnsTableHolder's parent path for auto-table which has no data path itself (e.g. GanttChart's embedded table in 8.3.21+)- Parameters:
item- the auto-table candidate, cannot benull- Returns:
- path of the parent of
TableHolder, can benull
-
-