Package com._1c.g5.v8.dt.xdto.util
Class XdtoUtil
- java.lang.Object
- 
- com._1c.g5.v8.dt.xdto.util.XdtoUtil
 
- 
 public final class XdtoUtil extends Object Useful method for working with xdto package elements
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classXdtoUtil.FacetKindXdtoValueTypefacet kinds
 - 
Field SummaryFields Modifier and Type Field Description static Set<String>PRIMITIVE_TYPE_NAMES
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 theqnamestatic List<QName>getMemberTypes(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 booleanisEquals(Type type, QName qname)Checks thatqnamelink to thetypestatic booleanisFacetAvailable(Type primitiveType, XdtoUtil.FacetKind facetKind)Checks that facet of primitive type can be fill
 
- 
- 
- 
Method Detail- 
isAnonymousTypepublic static boolean isAnonymousType(QName typeName) Checks that type corresponding to theQNameis anonymous- Parameters:
- typeName- checking type, can't be- null
- Returns:
- trueif type corresponding to the- QNameis anonymous,- falseotherwise
 
 - 
dependencyContainspublic static boolean dependencyContains(Package xdtoPackage, String nsUri) Checks that package contains the dependency in import section- Parameters:
- xdtoPackage-- Packagechecking package, can't be- null
- nsUri- looking up dependency uri
- Returns:
- trueif dependency was found,- falseotherwise
 
 - 
getItemTypepublic static QName getItemType(QName qname, org.eclipse.xtext.scoping.IScope scope, XdtoAdditionalIndexInformationHelper indexHelper) Gets item type ofTypecorresponding to theqname- Parameters:
- qname-- QNameof the- Type, can't be- null
- scope-- IScopecontains all xdto types, can't be- null
- indexHelper-- XdtoAdditionalIndexInformationHelperfor getting item type, can't be- null
- Returns:
- QNamecorresponding to the item type of- qnametype, or- nullif it doesn't have it
 
 - 
isEmptyQNamepublic static boolean isEmptyQName(QName qname) Checks thatQNameis empty- Parameters:
- qname- checking- QName
- Returns:
- trueif- qnameis- nullor- QName.getName()or- QName.getNsUri()is- nullor empty
 
 - 
getMemberTypespublic static List<QName> getMemberTypes(QName qname, org.eclipse.xtext.scoping.IScope scope, XdtoAdditionalIndexInformationHelper indexHelper) Gets merger types ofTypecorresponding to theqname- Parameters:
- qname-- QNameof the- Type, can't be- null
- scope-- IScopecontains all xdto types, can't be- null
- indexHelper-- XdtoAdditionalIndexInformationHelperfor getting merger types, can't be- null
- Returns:
- list of QNamecorresponding to the merger types ofqnametype, or empty list if it doesn't have it
 
 - 
getExpandNamepublic static String getExpandName(QName qname) Gets expand presentation ofQName: "{nsUri} localName"
 - 
getExpandNamepublic static String getExpandName(String nsUri, String localName) Gets expand presentation by nsUri and local name: "{nsUri} localName"- Parameters:
- nsUri- actual uri for getting expand presentation, can't be- null
- localName- actual local name for getting expand presentation, can't be- null
- Returns:
- expand presentation by nsUri and local name, never null
 
 - 
getPropertyPresentationpublic static String getPropertyPresentation(Property property) Gets string presentation ofProperty: localName$Name$Form$ns uri
 - 
isDescendantpublic 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
 - 
getPrimitiveTypepublic 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 be- null
- allTypes-- IScopeof all available xdto- Types, can't be- null
- qualifiedNameProvider- actual- IQualifiedNameProviderfor xdto, can't be- null
- version- actual project version, can't be- null
- Returns:
- found primitive type or nullif it wasn't found
 
 - 
getFacetsKindpublic static List<XdtoUtil.FacetKind> getFacetsKind(ValueType type) Gets all set facet ofValueType- Parameters:
- type- checking- ValueType, can't be- null
- Returns:
- list of set XdtoUtil.FacetKind, nevernull
 
 - 
getFacetNamepublic static String getFacetName(XdtoUtil.FacetKind facetKind) Gets facet kind name- Parameters:
- facetKind-- XdtoUtil.FacetKind, can't be- null
- Returns:
- name of the XdtoUtil.FacetKind, nevernull
 
 - 
isFacetAvailablepublic static boolean isFacetAvailable(Type primitiveType, XdtoUtil.FacetKind facetKind) Checks that facet of primitive type can be fill- Parameters:
- primitiveType- checking primitive xdto type, can't be- null
- facetKind- type of facet, can't be- null
- Returns:
- trueif value of facet kind can be set,- falseotherwise
 
 - 
getPropertyNamepublic static String getPropertyName(Property property) - Parameters:
- property-- Propertyfor getting name, can't be- null
- 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
 
 - 
getNamepublic static String getName(org.eclipse.emf.ecore.EObject eObject) Gets package model element e-object name.- Parameters:
- eObject- e-object, cannot be- null
- Returns:
- object name or nullif not supported
 
 
- 
 
-