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 AbstractDataPath
getDataPathForAutoTable(DataItem item)
ReturnsTableHolder
's parent path for auto-table which has no data path itself (e.g.static AbstractDataPath
getDataPathForCurrentScriptVariant(AbstractDataPath sourceDataPath, Form form, ScriptVariant scriptVariant, IDataSourceInfoAssociationService associationService)
static Integer[]
getIndexForSegment(AbstractDataPath path)
Gets indexes data for segmentsstatic boolean
hasIndex(AbstractDataPath path)
The method checks aAbstractDataPath
contains indexes datastatic boolean
isElementDataPath(AbstractDataPath path)
Checks the data path is a data path of form elementstatic boolean
isEqualDataPath(AbstractDataPath path1, AbstractDataPath path2)
Compares twoAbstractDataPath
object each other.static boolean
isEqualDataPath(AbstractFormDataSourceInfo info1, AbstractFormDataSourceInfo info2)
Compares twoAbstractFormDataSource#getDataPath(ScriptVariant)
object each other.static void
setIndexForSegment(AbstractDataPath path, Integer[] indexes)
Sets indexes data for segments of the data pathstatic boolean
startsWith(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 twoAbstractDataPath
object each other. The result istrue
if and only if they represents the same sequence of segments.- Parameters:
path1
- - a first pathpath2
- - 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 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:
true
if the given paths represents the same sequence of segments,false
otherwise.- 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:
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 aAbstractDataPath
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 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
-
-