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 EObjectTrie
createEObjectTrieForTopModelObjects(Collection<org.eclipse.emf.ecore.EObject> topModelObjects, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider)
Creates anEObjectTrie
from the given collection of top model objects.static Collection<TypeItem>
getAllProducingTypes(MdObject mdObject)
Gets collection of producing type ofmdObject
static Value
getDefaultStyleElementTypeValue(StyleElementType styleElementType, IV8Project v8project)
Returns default value for specified element type.static String
getFullyQualifiedName(Field field)
Returns the fully qualified name of anField
, ornull
if the name cannot be determined.static org.eclipse.xtext.naming.QualifiedName
getFullyQualifiedName(MdObject mdObject)
Returns the fully qualified name of an MdObject, ornull
if the name cannot be determined.static org.eclipse.xtext.naming.QualifiedName
getFullyQualifiedNameRu(MdObject mdObject)
Returns the fully qualified nameRu of an MdObject, ornull
if the name cannot be determined.static String
getFullyQualifiendNameRu(Field field)
Returns the Russian fully qualified name of anField
, ornull
if the name cannot be determined.static String
getModuleName(org.eclipse.emf.ecore.EReference reference)
Gets the name of the module which is referenced by the given object.static org.eclipse.xtext.naming.QualifiedName
getProxySupportsFullQualifiedName(MdObject mdObject)
Returns md-object qualified name.static org.eclipse.xtext.naming.QualifiedName
getTopMdObjectFullyQualifiedName(org.eclipse.emf.ecore.EClass eClass, String name)
Gets FQN of the MD object identified by the givenEClass
and name.static boolean
hasRealDatabasePresentation(MdObject object)
Checks thatobject
has real association with databasestatic boolean
isIndependentObject(Object object)
Checks object is independent forStandaloneContent
.static boolean
isMobileApplicationUsePurposes(IV8Project v8Project)
Checks if the specifiedIV8Project
has only one mobile application use purpose.static boolean
isMobileApplicationUsePurposes(Collection<ApplicationUsePurpose> usePurposes)
Deprecated.static boolean
isSuppressSettingsFeature(org.eclipse.emf.ecore.EStructuralFeature reference)
Returnstrue
ifEStructuralFeature
represents a suppression objectstatic boolean
isUserSettable(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, ornull
if the name cannot be determined. Some examples of the returned names:Сonfiguration1
(only Configuration objects may have a one-segment name)Catalog.Catalog1
Catalog.Catalog1.Attribute.Attribute1
- Parameters:
mdObject
- notnull
- Returns:
- the fully qualified name of an MdObject, or
null
if 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 givenEClass
and name.- Parameters:
eClass
- theEClass
of the object, may not benull
, must be descendant of MD_OBJECT.name
- the name of the object ornull
if 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, ornull
if the name cannot be determined. Some examples of the returned names:Сonfiguration1
(only Configuration objects may have a one-segment name)Catalog.Catalog1
Catalog.Catalog1.Attribute.Attribute1
- Parameters:
mdObject
- notnull
- Returns:
- the fully qualified nameRu of an MdObject, or
null
if 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:
true
if the given feature is settable by the user, andfalse
if 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 ofApplicationUsePurpose
elements for check, cannot benull
- Returns:
true
if given collection is only for mobile applications,false
in otherwise
-
isMobileApplicationUsePurposes
public static boolean isMobileApplicationUsePurposes(IV8Project v8Project)
Checks if the specifiedIV8Project
has only one mobile application use purpose.- Parameters:
v8Project
- theIV8Project
for check, can benull
- Returns:
true
if the givenIV8Project
has only one mobile application use purpose andfalse
if the givenIV8Project
isnull
or 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 anEObjectTrie
from the given collection of top model objects.- Parameters:
topModelObjects
- the given collection of top model objects, cannot benull
qualifiedNameProvider
- the qualified name provider, cannot benull
- Returns:
- the created
EObjectTrie
, nevernull
-
hasRealDatabasePresentation
public static boolean hasRealDatabasePresentation(MdObject object)
Checks thatobject
has real association with database- Parameters:
object
- checking object, cannot benull
- Returns:
true
if object has presentation in database,false
otherwise
-
getDefaultStyleElementTypeValue
public static Value getDefaultStyleElementTypeValue(StyleElementType styleElementType, IV8Project v8project)
Returns default value for specified element type.- Parameters:
styleElementType
- the style elemet type, cannot benull
v8project
- the v8 project, cannot benull
- Returns:
- the default value, can be
null
-
isSuppressSettingsFeature
public static boolean isSuppressSettingsFeature(org.eclipse.emf.ecore.EStructuralFeature reference)
Returnstrue
ifEStructuralFeature
represents a suppression object- Parameters:
reference
- the feature reference, cannot benull
- Returns:
true
ifEStructuralFeature
represents a suppression object
-
getFullyQualifiedName
public static String getFullyQualifiedName(Field field)
Returns the fully qualified name of anField
, ornull
if the name cannot be determined.
-
getFullyQualifiendNameRu
public static String getFullyQualifiendNameRu(Field field)
Returns the Russian fully qualified name of anField
, ornull
if 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:
true
is independent,false
otherwise
-
-