Package com._1c.g5.v8.dt.dcs.util
Class DcsUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.dcs.util.DcsUtil
-
public class DcsUtil extends Object
Вспомогательные функции
-
-
Constructor Summary
Constructors Constructor Description DcsUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
appendValueList(TypedValueList to, TypedValueList from)
Добавить один список в другойstatic void
clearDuplicatesValueList(TypedValueList valueList)
Удалить дублирующиеся значения в спискеstatic Font
createDefaultFont(Version version)
static TypeItem
createType(String typeName, Version version)
Создать тип по имениstatic TypeDescription
createTypeDescription(String typeName, Version version)
Создать тип по имениstatic String
dscPathToSynonym(String path)
Get field synonym by data pathstatic org.eclipse.emf.ecore.EObject
getContextObject(IV8Project v8project)
Gets context object for resolvingstatic String
getDateTimePattern(boolean isOnlyDate, boolean isOnlyTime)
Get date time patternstatic List<DbViewFieldDef>
getFieldsByTypeDescription(SettingsContext settingsContext, TypeDescription typeDescription)
Returns fields provided by type description or empty list.static String
getLangString(LocalString str, Language lang)
Получить строку из многоязыковой строки по языкуstatic String
getLangString(LocalString str, String langCode)
Get current string from local stringstatic String
getLangString(Presentation presentation, Language lang)
Получить строку из представления по языкуstatic String
getLangString(Presentation presentation, String langCode)
Get current string from presentationstatic String
getNextName(String template, List<String> names)
Сгенерировать следующее имя объектаstatic <T> T
getQlDcsService(Class<T> type)
static QuerySchema
getQuerySchema(String queryString, IDtProject project)
CreateQuerySchema
by query stringstatic Collection<Type>
getResolvedTypes(TypeDescription typeDescription, org.eclipse.emf.ecore.EObject context)
Get collection of resolved types from type descriptionstatic Collection<Type>
getResolvedTypes(TypeDescriptionSource tdp, SettingsContext settingsContext)
Gets the collection of resolved type items, with typesets being taken into the accountstatic TypedValueList
getValueList(IV8Project v8project, String langCode, List<AvailableValue> eList)
Create TypedValueList from list of available valuesstatic TypeDescription
merge(TypeDescription type1, TypeDescription type2)
Check types and mergestatic String
nameToSynonym(String str)
Сформировать синоним по имениstatic <T> T
parse(String textToParse, org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, IDtProject dtProject, Map<?,?> options, List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> outputErrors)
static String
pathToSynonym(DcsPath path)
Сформировать синоним по путиstatic <T extends org.eclipse.emf.ecore.EObject>
TresolveProxy(T object, SettingsContext settingsContext)
-
-
-
Method Detail
-
nameToSynonym
public static String nameToSynonym(String str)
Сформировать синоним по имени- Parameters:
str
- имя- Returns:
- синоним
-
pathToSynonym
public static String pathToSynonym(DcsPath path) throws DcsPathException
Сформировать синоним по пути- Parameters:
path
- путь- Returns:
- синоним
- Throws:
DcsPathException
-
createTypeDescription
public static TypeDescription createTypeDescription(String typeName, Version version)
Создать тип по имени- Parameters:
typeName
- имя типаversion
- версия- Returns:
- тип
-
getLangString
public static String getLangString(Presentation presentation, Language lang)
Получить строку из представления по языку- Parameters:
presentation
- представлениеlang
- язык- Returns:
- строка языка
-
getLangString
public static String getLangString(Presentation presentation, String langCode)
Get current string from presentation- Parameters:
presentation
- presentationlangCode
- current language code- Returns:
- current string
-
getLangString
public static String getLangString(LocalString str, Language lang)
Получить строку из многоязыковой строки по языку- Parameters:
str
- многоязыковая строкаlang
- язык- Returns:
- строка языка
-
getLangString
public static String getLangString(LocalString str, String langCode)
Get current string from local string- Parameters:
str
- local stringlangCode
- current language code- Returns:
- current string
-
getValueList
public static TypedValueList getValueList(IV8Project v8project, String langCode, List<AvailableValue> eList)
Create TypedValueList from list of available values- Parameters:
v8project
- the V8 project, can't be nulllangCode
- current language code, can't be nulleList
- list of available values- Returns:
- TypedValueList list, never null
-
appendValueList
public static void appendValueList(TypedValueList to, TypedValueList from)
Добавить один список в другой- Parameters:
to
- цельfrom
- добавляемый
-
clearDuplicatesValueList
public static void clearDuplicatesValueList(TypedValueList valueList)
Удалить дублирующиеся значения в списке- Parameters:
valueList
- список
-
getQuerySchema
public static QuerySchema getQuerySchema(String queryString, IDtProject project) throws DcsDataSetInfoException
CreateQuerySchema
by query string- Parameters:
queryString
- text of the queryproject
- actual project containing the query resource- Returns:
- created
QuerySchema
- Throws:
DcsDataSetInfoException
-
getQlDcsService
public static <T> T getQlDcsService(Class<T> type)
-
createType
public static TypeItem createType(String typeName, Version version)
Создать тип по имени- Parameters:
typeName
- имя типаversion
- версия- Returns:
- тип
-
getResolvedTypes
public static Collection<Type> getResolvedTypes(TypeDescription typeDescription, org.eclipse.emf.ecore.EObject context)
Get collection of resolved types from type description- Parameters:
typeDescription
- type description, can't be nullcontext
- context object for resolving, can't be null- Returns:
- collection of resolved types, never null
-
merge
public static TypeDescription merge(TypeDescription type1, TypeDescription type2)
Check types and merge- Parameters:
type1
- first type, can't be nulltype2
- second type, can't be null- Returns:
- type or null if both types are null
-
getDateTimePattern
public static String getDateTimePattern(boolean isOnlyDate, boolean isOnlyTime)
Get date time pattern- Parameters:
isOnlyDate
- - is show only dateisOnlyTime
- - is show only time- Returns:
- date time pattern
-
getContextObject
public static org.eclipse.emf.ecore.EObject getContextObject(IV8Project v8project)
Gets context object for resolving- Parameters:
v8project
- contextIV8Project
, can't benull
- Returns:
- context object for the
#v8project
, nevernull
-
dscPathToSynonym
public static String dscPathToSynonym(String path)
Get field synonym by data path- Parameters:
path
- field data path, can't be null- Returns:
- field synonym, never null
-
getNextName
public static String getNextName(String template, List<String> names)
Сгенерировать следующее имя объекта- Parameters:
template
- шаблонная часть имени (НаборДанных), не может бытьnull
names
- существующие имена (НаборДанных1, НаборДанных2), не может бытьnull
- Returns:
- следующее имя (НаборДанных3), никогда не
null
-
parse
public static <T> T parse(String textToParse, org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.ResourceSet resourceSet, IDtProject dtProject, Map<?,?> options, List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> outputErrors)
-
getResolvedTypes
public static Collection<Type> getResolvedTypes(TypeDescriptionSource tdp, SettingsContext settingsContext)
Gets the collection of resolved type items, with typesets being taken into the account- Parameters:
tdp
- TheTypeDescriptionSource
that represent the type. May not benull
settingsContext
- The context object to use for the resolution. May not benull
- Returns:
- The collection of resolved types. Never
null
-
getFieldsByTypeDescription
public static List<DbViewFieldDef> getFieldsByTypeDescription(SettingsContext settingsContext, TypeDescription typeDescription)
Returns fields provided by type description or empty list.- Parameters:
settingsContext
- The context object to use for the resolution. May not benull
typeDescription
- theTypeDescription
(may benull
)- Returns:
- fields from dbviews provided by field types or empty list.
-
resolveProxy
public static <T extends org.eclipse.emf.ecore.EObject> T resolveProxy(T object, SettingsContext settingsContext)
-
-