Package com._1c.g5.v8.dt.md
Class MdUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.md.MdUtil
-
public class MdUtil extends Object
Utility class
-
-
Constructor Summary
Constructors Constructor Description MdUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static EObjectTriecreateEObjectTrieForTopModelObjects(Collection<org.eclipse.emf.ecore.EObject> topModelObjects, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider)Creates anEObjectTriefrom the given collection of top model objects.static Collection<TypeItem>getAllProducingTypes(MdObject mdObject)Gets collection of producing type ofmdObjectstatic ValuegetDefaultStyleElementTypeValue(StyleElementType styleElementType, IV8Project v8project)Returns default value for specified element type.static StringgetFullyQualifiedName(Field field)Returns the fully qualified name of anField, ornullif the name cannot be determined.static org.eclipse.xtext.naming.QualifiedNamegetFullyQualifiedName(MdObject mdObject)Returns the fully qualified name of an MdObject, ornullif the name cannot be determined.static org.eclipse.xtext.naming.QualifiedNamegetFullyQualifiedNameRu(MdObject mdObject)Returns the fully qualified nameRu of an MdObject, ornullif the name cannot be determined.static StringgetFullyQualifiendNameRu(Field field)Returns the Russian fully qualified name of anField, ornullif the name cannot be determined.static StringgetMdName(MdObject mdObject, String code)Returns the name of theMdObject.static StringgetModuleName(org.eclipse.emf.ecore.EReference reference)Gets the name of the module which is referenced by the given object.static org.eclipse.xtext.naming.QualifiedNamegetProxySupportsFullQualifiedName(MdObject mdObject)Returns md-object qualified name.static org.eclipse.xtext.naming.QualifiedNamegetTopMdObjectFullyQualifiedName(org.eclipse.emf.ecore.EClass eClass, String name)Gets FQN of the MD object identified by the givenEClassand name.static booleanhasRealDatabasePresentation(MdObject object)Checks thatobjecthas real association with databasestatic booleanisIndependentObject(Object object)Checks object is independent forStandaloneContent.static booleanisMobileApplicationUsePurposes(IV8Project v8Project)Checks if the specifiedIV8Projecthas only one mobile application use purpose.static booleanisMobileApplicationUsePurposes(Collection<ApplicationUsePurpose> usePurposes)Deprecated.static booleanisSuppressSettingsFeature(org.eclipse.emf.ecore.EStructuralFeature reference)ReturnstrueifEStructuralFeaturerepresents a suppression objectstatic booleanisUserSettable(org.eclipse.emf.ecore.EStructuralFeature feature)Returns whether the given feature is settable by the user (i.e.
-
-
-
Method Detail
-
getFullyQualifiedName
public static org.eclipse.xtext.naming.QualifiedName getFullyQualifiedName(MdObject mdObject)
Returns the fully qualified name of an MdObject, ornullif the name cannot be determined. Some examples of the returned names:Сonfiguration1(only Configuration objects may have a one-segment name)Catalog.Catalog1Catalog.Catalog1.Attribute.Attribute1
- Parameters:
mdObject- notnull- Returns:
- the fully qualified name of an MdObject, or
nullif the name cannot be determined
-
getTopMdObjectFullyQualifiedName
public static org.eclipse.xtext.naming.QualifiedName getTopMdObjectFullyQualifiedName(org.eclipse.emf.ecore.EClass eClass, String name)Gets FQN of the MD object identified by the givenEClassand name.- Parameters:
eClass- theEClassof the object, may not benull, must be descendant of MD_OBJECT.name- the name of the object ornullif is not applicable.- Returns:
- the FQN, not
null.
-
getFullyQualifiedNameRu
public static org.eclipse.xtext.naming.QualifiedName getFullyQualifiedNameRu(MdObject mdObject)
Returns the fully qualified nameRu of an MdObject, ornullif the name cannot be determined. Some examples of the returned names:Сonfiguration1(only Configuration objects may have a one-segment name)Catalog.Catalog1Catalog.Catalog1.Attribute.Attribute1
- Parameters:
mdObject- notnull- Returns:
- the fully qualified nameRu of an MdObject, or
nullif the name cannot be determined
-
isUserSettable
public static boolean isUserSettable(org.eclipse.emf.ecore.EStructuralFeature feature)
Returns whether the given feature is settable by the user (i.e. not "special").- Parameters:
feature- notnull- Returns:
trueif the given feature is settable by the user, andfalseif the feature is "special"
-
getModuleName
public static String getModuleName(org.eclipse.emf.ecore.EReference reference)
Gets the name of the module which is referenced by the given object.- Parameters:
reference- the reference.- Returns:
- the module name.
-
isMobileApplicationUsePurposes
@Deprecated public static boolean isMobileApplicationUsePurposes(Collection<ApplicationUsePurpose> usePurposes)
Deprecated.The specified collection ofApplicationUsePurpose-s is only for mobile applications- Parameters:
usePurposes- the collection ofApplicationUsePurposeelements for check, cannot benull- Returns:
trueif given collection is only for mobile applications,falsein otherwise
-
isMobileApplicationUsePurposes
public static boolean isMobileApplicationUsePurposes(IV8Project v8Project)
Checks if the specifiedIV8Projecthas only one mobile application use purpose.- Parameters:
v8Project- theIV8Projectfor check, can benull- Returns:
trueif the givenIV8Projecthas only one mobile application use purpose andfalseif the givenIV8Projectisnullor has empty use purposes or has personal computer use purpose
-
getAllProducingTypes
public static Collection<TypeItem> getAllProducingTypes(MdObject mdObject)
Gets collection of producing type ofmdObject- Parameters:
mdObject- object for getting it producing types, can't benull- Returns:
- collection of producing type of
mdObject, nevernull
-
createEObjectTrieForTopModelObjects
public static EObjectTrie createEObjectTrieForTopModelObjects(Collection<org.eclipse.emf.ecore.EObject> topModelObjects, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider)
Creates anEObjectTriefrom the given collection of top model objects.- Parameters:
topModelObjects- the given collection of top model objects, cannot benullqualifiedNameProvider- the qualified name provider, cannot benull- Returns:
- the created
EObjectTrie, nevernull
-
hasRealDatabasePresentation
public static boolean hasRealDatabasePresentation(MdObject object)
Checks thatobjecthas real association with database- Parameters:
object- checking object, cannot benull- Returns:
trueif object has presentation in database,falseotherwise
-
getDefaultStyleElementTypeValue
public static Value getDefaultStyleElementTypeValue(StyleElementType styleElementType, IV8Project v8project)
Returns default value for specified element type.- Parameters:
styleElementType- the style elemet type, cannot benullv8project- the v8 project, cannot benull- Returns:
- the default value, can be
null
-
isSuppressSettingsFeature
public static boolean isSuppressSettingsFeature(org.eclipse.emf.ecore.EStructuralFeature reference)
ReturnstrueifEStructuralFeaturerepresents a suppression object- Parameters:
reference- the feature reference, cannot benull- Returns:
trueifEStructuralFeaturerepresents a suppression object
-
getFullyQualifiedName
public static String getFullyQualifiedName(Field field)
Returns the fully qualified name of anField, ornullif the name cannot be determined.
-
getFullyQualifiendNameRu
public static String getFullyQualifiendNameRu(Field field)
Returns the Russian fully qualified name of anField, ornullif the name cannot be determined.
-
getProxySupportsFullQualifiedName
public static org.eclipse.xtext.naming.QualifiedName getProxySupportsFullQualifiedName(MdObject mdObject)
Returns md-object qualified name. Proxy supports.- Parameters:
mdObject- the md-object, cannot benull, may be proxy- Returns:
- the qualified name, cannot be
null
-
isIndependentObject
public static boolean isIndependentObject(Object object)
Checks object is independent forStandaloneContent.- Parameters:
object- the object, cannot benull- Returns:
trueis independent,falseotherwise
-
-