Class MdCompareUtils
java.lang.Object
com._1c.g5.v8.dt.internal.md.compare.MdCompareUtils
Utility methods used for comparison and merge model objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionCollection of all reference to metadata objects from Configuration, without Languages -
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.emf.ecore.EStructuralFeature
adoptMainSideFeature
(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature, IComparisonSession session) Converts, if possible, the main side feature into a other supported by the other side object.static org.eclipse.emf.ecore.EStructuralFeature
adoptOtherSideFeature
(org.eclipse.emf.ecore.EStructuralFeature otherSideFeature, IComparisonSession session) Converts, if possible, the other side feature into a main supported by the main side object.static ComparisonFlags
compareFiles
(Collection<Path> files, IComparisonSession session) Compares a collection of files, takes a content of a file from the comparison data sources.static List<org.eclipse.emf.ecore.EReference>
getChildFeatures
(MdObjectCollectionElementComparisonNode node, IComparisonSession comparisonSession) Returns features of node in sorted order.static org.eclipse.emf.ecore.EReference
getReferenceFromConfiguration
(org.eclipse.emf.ecore.EClass eClass) Returns a reference from the configuration whose type is equal to the specifiedEClass
.static List<org.eclipse.emf.ecore.EReference>
Gets configuration top level navigator ordered references.static org.eclipse.emf.ecore.EClass
getTopParentEClass
(String symlink) Returns the top model parentEClass
of the object represented by the given symlink.static String
getTopParentSymlink
(String symlink) Returns the top model parent symlink of the object represented by the given symlink.static boolean
isExcludedFromComparison
(org.eclipse.emf.ecore.EStructuralFeature feature, AbstractComparedEmfObjects<?> comparedContextObjects, IComparisonSession session, IMdPropertyTypeProvider propertyTypeProvider, IMdAdoptedPropertyAccess adoptedPropertyAccess, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider) Checks whether the feature must be excluded from the comparison.static boolean
Checks whether the object may be renamed on merge.
-
Field Details
-
CONFIGURATION_TOP_LEVEL_REFS
Collection of all reference to metadata objects from Configuration, without Languages
-
-
Method Details
-
adoptMainSideFeature
public static org.eclipse.emf.ecore.EStructuralFeature adoptMainSideFeature(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature, IComparisonSession session) Converts, if possible, the main side feature into a other supported by the other side object. By default returns the given main side feature.- Parameters:
mainSideFeature
- the main side feature to convert, cannot benull
session
- the comparison session, cannot benull
- Returns:
- the converted feature applicable for other side object or
null
-
adoptOtherSideFeature
public static org.eclipse.emf.ecore.EStructuralFeature adoptOtherSideFeature(org.eclipse.emf.ecore.EStructuralFeature otherSideFeature, IComparisonSession session) Converts, if possible, the other side feature into a main supported by the main side object. By default returns the given other side feature.- Parameters:
otherSideFeature
- the main side feature to convert, cannot benull
session
- the comparison session, cannot benull
- Returns:
- the converted feature applicable for other side object, never
null
-
isExcludedFromComparison
public static boolean isExcludedFromComparison(org.eclipse.emf.ecore.EStructuralFeature feature, AbstractComparedEmfObjects<?> comparedContextObjects, IComparisonSession session, IMdPropertyTypeProvider propertyTypeProvider, IMdAdoptedPropertyAccess adoptedPropertyAccess, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider) Checks whether the feature must be excluded from the comparison.- Parameters:
feature
- the feature to check, cannot benull
comparedContextObjects
- the triple of compared objects, cannot benull
session
- the comparison session, cannot benull
qualifiedNameProvider
- the qualified name provider, cannot benull
- Returns:
true
if the feature must be excluded orfalse
otherwise
-
isObjectToBeRenamed
Checks whether the object may be renamed on merge.- Parameters:
node
- the node accociated with object to check, cannot benull
- Returns:
true
if the object may be renamed on merge,false
otherwise
-
getTopParentEClass
Returns the top model parentEClass
of the object represented by the given symlink.- Parameters:
symlink
- the object symlink to get the top model parentEClass
for, cannot benull
- Returns:
- the top model parent
EClass
, nevernull
-
getTopParentSymlink
Returns the top model parent symlink of the object represented by the given symlink.- Parameters:
symlink
- the object symlink to get the top model parent symlink for, cannot benull
- Returns:
- the top model parent symlink, never
null
-
getReferenceFromConfiguration
public static org.eclipse.emf.ecore.EReference getReferenceFromConfiguration(org.eclipse.emf.ecore.EClass eClass) Returns a reference from the configuration whose type is equal to the specifiedEClass
.- Parameters:
eClass
- theEClass
to get the reference from the configuration for, cannot benull
- Returns:
- the reference from configuration or
null
if no such reference is known
-
compareFiles
Compares a collection of files, takes a content of a file from the comparison data sources.- Parameters:
files
- the collections of files to compare, cannot benull
session
- the related comparison session, cannot benull
- Returns:
- the comparison result, never
null
-
getTopObjectReferences
Gets configuration top level navigator ordered references.- Returns:
- configuration top level navigator ordered references, never
null
-
getChildFeatures
public static List<org.eclipse.emf.ecore.EReference> getChildFeatures(MdObjectCollectionElementComparisonNode node, IComparisonSession comparisonSession) Returns features of node in sorted order.- Parameters:
node
- node for which internal menu structure is to be retrieved, cannot benull
comparisonSession
- session related to node, cannot benull
- Returns:
- features of node in sorted order, may be
null
if no internal menu structure is found for given node, may benull
when unknown node is given
-