Package com._1c.g5.v8.dt.xdto.util
Class XdtoUtil
java.lang.Object
com._1c.g5.v8.dt.xdto.util.XdtoUtil
Useful method for working with xdto package elements
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic QNamecreateQName(String name, String nsUri) CreatesQNamestatic booleandependencyContains(Package xdtoPackage, String nsUri) Checks that package contains the dependency in import sectionstatic StringgetExpandName(QName qname) Gets expand presentation ofQName: "{nsUri} localName"static StringgetExpandName(String nsUri, String localName) Gets expand presentation by nsUri and local name: "{nsUri} localName"static StringgetFacetName(XdtoUtil.FacetKind facetKind) Gets facet kind namestatic List<XdtoUtil.FacetKind>getFacetsKind(ValueType type) Gets all set facet ofValueTypestatic QNamegetItemType(QName qname, org.eclipse.xtext.scoping.IScope scope, XdtoAdditionalIndexInformationHelper indexHelper) Gets item type ofTypecorresponding to theqnamegetMemberTypes(QName qname, org.eclipse.xtext.scoping.IScope scope, XdtoAdditionalIndexInformationHelper indexHelper) Gets merger types ofTypecorresponding to theqnamestatic StringgetName(org.eclipse.emf.ecore.EObject eObject) Gets package model element e-object name.static TypegetPrimitiveType(Type type, org.eclipse.xtext.scoping.IScope allTypes, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider, Version version) Gets primitive xdto type corresponding to thetypestatic StringgetPropertyName(Property property) static StringgetPropertyPresentation(Property property) Gets string presentation ofProperty: localName$Name$Form$ns uristatic booleanisAnonymousType(QName typeName) Checks that type corresponding to theQNameis anonymousstatic booleanisDescendant(QName type, QName childType, org.eclipse.xtext.scoping.IScope allTypes, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider, XdtoAdditionalIndexInformationHelper additionalIndexInformationHelper) Checks thattypeis descendant forchildType.static booleanisEmptyQName(QName qname) Checks thatQNameis emptystatic booleanChecks thatqnamelink to thetypestatic booleanisFacetAvailable(Type primitiveType, XdtoUtil.FacetKind facetKind) Checks that facet of primitive type can be fill
-
Field Details
-
PRIMITIVE_TYPE_NAMES
-
-
Method Details
-
isAnonymousType
Checks that type corresponding to theQNameis anonymous- Parameters:
typeName- checking type, can't benull- Returns:
trueif type corresponding to theQNameis anonymous,falseotherwise
-
dependencyContains
Checks that package contains the dependency in import section- Parameters:
xdtoPackage-Packagechecking package, can't benullnsUri- looking up dependency uri- Returns:
trueif dependency was found,falseotherwise
-
isEquals
Checks thatqnamelink to thetype -
getItemType
public static QName getItemType(QName qname, org.eclipse.xtext.scoping.IScope scope, XdtoAdditionalIndexInformationHelper indexHelper) Gets item type ofTypecorresponding to theqname- Parameters:
qname-QNameof theType, can't benullscope-IScopecontains all xdto types, can't benullindexHelper-XdtoAdditionalIndexInformationHelperfor getting item type, can't benull- Returns:
QNamecorresponding to the item type ofqnametype, ornullif it doesn't have it
-
isEmptyQName
Checks thatQNameis empty- Parameters:
qname- checkingQName- Returns:
trueifqnameisnullorQName.getName()orQName.getNsUri()isnullor empty
-
getMemberTypes
public static List<QName> getMemberTypes(QName qname, org.eclipse.xtext.scoping.IScope scope, XdtoAdditionalIndexInformationHelper indexHelper) Gets merger types ofTypecorresponding to theqname- Parameters:
qname-QNameof theType, can't benullscope-IScopecontains all xdto types, can't benullindexHelper-XdtoAdditionalIndexInformationHelperfor getting merger types, can't benull- Returns:
- list of
QNamecorresponding to the merger types ofqnametype, or empty list if it doesn't have it
-
getExpandName
Gets expand presentation ofQName: "{nsUri} localName" -
getExpandName
Gets expand presentation by nsUri and local name: "{nsUri} localName"- Parameters:
nsUri- actual uri for getting expand presentation, can't benulllocalName- actual local name for getting expand presentation, can't benull- Returns:
- expand presentation by nsUri and local name, never
null
-
getPropertyPresentation
Gets string presentation ofProperty: localName$Name$Form$ns uri -
isDescendant
public static boolean isDescendant(QName type, QName childType, org.eclipse.xtext.scoping.IScope allTypes, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider, XdtoAdditionalIndexInformationHelper additionalIndexInformationHelper) Checks thattypeis descendant forchildType. Step by step comparetypeand base types ofchildType -
getPrimitiveType
public static Type getPrimitiveType(Type type, org.eclipse.xtext.scoping.IScope allTypes, org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider, Version version) Gets primitive xdto type corresponding to thetype- Parameters:
type-Typefor getting it primitive type, can't benullallTypes-IScopeof all available xdtoTypes, can't benullqualifiedNameProvider- actualIQualifiedNameProviderfor xdto, can't benullversion- actual project version, can't benull- Returns:
- found primitive type or
nullif it wasn't found
-
getFacetsKind
Gets all set facet ofValueType- Parameters:
type- checkingValueType, can't benull- Returns:
- list of set
XdtoUtil.FacetKind, nevernull
-
getFacetName
Gets facet kind name- Parameters:
facetKind-XdtoUtil.FacetKind, can't benull- Returns:
- name of the
XdtoUtil.FacetKind, nevernull
-
isFacetAvailable
Checks that facet of primitive type can be fill- Parameters:
primitiveType- checking primitive xdto type, can't benullfacetKind- type of facet, can't benull- Returns:
trueif value of facet kind can be set,falseotherwise
-
getPropertyName
- Parameters:
property-Propertyfor getting name, can't benull- Returns:
- actual
Propertyname: ifProperty.getName()isnullor empty return name of reference property. Can benullif property and reference property don't have names or there is no refernce property
-
createQName
CreatesQName -
getName
Gets package model element e-object name.- Parameters:
eObject- e-object, cannot benull- Returns:
- object name or
nullif not supported
-