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.EStructuralFeatureadoptMainSideFeature(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.EStructuralFeatureadoptOtherSideFeature(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 ComparisonFlagscompareFiles(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.EReferencegetReferenceFromConfiguration(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.EClassgetTopParentEClass(String symlink) Returns the top model parentEClassof the object represented by the given symlink.static StringgetTopParentSymlink(String symlink) Returns the top model parent symlink of the object represented by the given symlink.static booleanisExcludedFromComparison(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 booleanChecks 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 benullsession- 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 benullsession- 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 benullcomparedContextObjects- the triple of compared objects, cannot benullsession- the comparison session, cannot benullqualifiedNameProvider- the qualified name provider, cannot benull- Returns:
trueif the feature must be excluded orfalseotherwise
-
isObjectToBeRenamed
Checks whether the object may be renamed on merge.- Parameters:
node- the node accociated with object to check, cannot benull- Returns:
trueif the object may be renamed on merge,falseotherwise
-
getTopParentEClass
Returns the top model parentEClassof the object represented by the given symlink.- Parameters:
symlink- the object symlink to get the top model parentEClassfor, 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- theEClassto get the reference from the configuration for, cannot benull- Returns:
- the reference from configuration or
nullif 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 benullsession- 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 benullcomparisonSession- session related to node, cannot benull- Returns:
- features of node in sorted order, may be
nullif no internal menu structure is found for given node, may benullwhen unknown node is given
-