Class DataSetsFieldsWrapperBase<T extends DataSetField>
- java.lang.Object
-
- com._1c.g5.v8.dt.dcs.dataset.fields.DataSetsFieldsWrapperBase<T>
-
- All Implemented Interfaces:
IDataSetFieldsWrapper
,Comparable<IDataSetFieldsWrapper>
- Direct Known Subclasses:
DataSetsFieldsWrapperField
,DataSetsFieldsWrapperWithChildrenBase
public abstract class DataSetsFieldsWrapperBase<T extends DataSetField> extends Object implements IDataSetFieldsWrapper
Base class for field wrapper
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com._1c.g5.v8.dt.dcs.dataset.fields.IDataSetFieldsWrapper
IDataSetFieldsWrapper.FieldCommand, IDataSetFieldsWrapper.FieldRenameException
-
-
Field Summary
Fields Modifier and Type Field Description protected IDataSetWrapper
dataSetWrapper
protected T
field
-
Constructor Summary
Constructors Constructor Description DataSetsFieldsWrapperBase(IDataSetWrapper dataSetWrapper, T field)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(IDataSetFieldsWrapper other)
protected String
getCurrentLanguageCode()
Get current language codeprotected String
getDuplicatedErrorMessage(List<String> fieldsDuplicated)
Create message for duplicated fieldsDataSetField
getField()
Get fieldprotected DataSetField
getFieldByPath(String path)
Get field by pathprotected Collection<IDataSetFieldsWrapper>
getFieldsWrappers()
Get fields wrappers for this data setprotected String
getParentPath()
Get path of field parentprotected DcsPath
getPathFromString(String path)
Create DcsPath from textprotected IDataSetWrapper.FieldSynonym
getSynonym(String path)
Get field synonym by pathString
getTitle(String languageCode)
Get title for current languageboolean
isFolder()
Check whether field is folderprotected boolean
isNameUnique(String name)
Check whether name is uniqueprotected boolean
isPathUnique(String path)
Check whether path is uniqueprotected boolean
isStringEquals(String value1, String value2)
Check whether strings equalIDataSetFieldsWrapper.FieldCommand
setTitle(LocalString local)
Set titleprotected IDataSetFieldsWrapper.FieldCommand
setTitle(String langTitle, String languageCode)
Set titleprotected boolean
startsWith(String value1, String value2)
Check whether begining of string equals another stringprotected void
throwError(String error)
Throw renaming exception-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.v8.dt.dcs.dataset.fields.IDataSetFieldsWrapper
copy, getName, getPath, getTitle, isTitleAuto, remove, setName, setPath, setTitle
-
-
-
-
Field Detail
-
field
protected T extends DataSetField field
-
dataSetWrapper
protected IDataSetWrapper dataSetWrapper
-
-
Constructor Detail
-
DataSetsFieldsWrapperBase
public DataSetsFieldsWrapperBase(IDataSetWrapper dataSetWrapper, T field)
Constructor- Parameters:
dataSetWrapper
- data set wrapper, can't be nullfield
- field, can't be null
-
-
Method Detail
-
compareTo
public int compareTo(IDataSetFieldsWrapper other)
- Specified by:
compareTo
in interfaceComparable<T extends DataSetField>
-
getField
public DataSetField getField()
Description copied from interface:IDataSetFieldsWrapper
Get field- Specified by:
getField
in interfaceIDataSetFieldsWrapper
- Returns:
- field, never null
-
getTitle
public String getTitle(String languageCode)
Description copied from interface:IDataSetFieldsWrapper
Get title for current language- Specified by:
getTitle
in interfaceIDataSetFieldsWrapper
- Returns:
- title, never null
-
setTitle
public IDataSetFieldsWrapper.FieldCommand setTitle(LocalString local)
Description copied from interface:IDataSetFieldsWrapper
Set title- Specified by:
setTitle
in interfaceIDataSetFieldsWrapper
- Parameters:
local
- title, can't be null- Returns:
- command, never null
-
isFolder
public boolean isFolder()
Description copied from interface:IDataSetFieldsWrapper
Check whether field is folder- Specified by:
isFolder
in interfaceIDataSetFieldsWrapper
- Returns:
- whether field is folder
-
setTitle
protected IDataSetFieldsWrapper.FieldCommand setTitle(String langTitle, String languageCode)
Set title- Parameters:
langTitle
- title for current language, can't be nulllanguageCode
- current language code, can't be null- Returns:
- command, never null
-
isNameUnique
protected boolean isNameUnique(String name)
Check whether name is unique- Parameters:
name
- name, can't be null- Returns:
- whether name is unique
-
isPathUnique
protected boolean isPathUnique(String path)
Check whether path is unique- Parameters:
path
- path, can't be null- Returns:
- whether path is unique
-
isStringEquals
protected boolean isStringEquals(String value1, String value2)
Check whether strings equal- Parameters:
value1
- string, can be nullvalue2
- other string, can be null- Returns:
- whether strings is equals
-
startsWith
protected boolean startsWith(String value1, String value2)
Check whether begining of string equals another string- Parameters:
value1
- string, can be nullvalue2
- other string, can be null- Returns:
- whether begining of string equals another string
-
getDuplicatedErrorMessage
protected String getDuplicatedErrorMessage(List<String> fieldsDuplicated)
Create message for duplicated fields- Parameters:
fieldsDuplicated
- fields names, can't be null- Returns:
- message, never null
-
getCurrentLanguageCode
protected String getCurrentLanguageCode()
Get current language code- Returns:
- language code, never null
-
throwError
protected void throwError(String error) throws IDataSetFieldsWrapper.FieldRenameException
Throw renaming exception- Parameters:
error
- error text- Throws:
IDataSetFieldsWrapper.FieldRenameException
-
getPathFromString
protected DcsPath getPathFromString(String path) throws IDataSetFieldsWrapper.FieldRenameException
Create DcsPath from text- Parameters:
path
- path text, can't be null- Returns:
- DcsPath
- Throws:
IDataSetFieldsWrapper.FieldRenameException
- if path is not valid
-
getSynonym
protected IDataSetWrapper.FieldSynonym getSynonym(String path)
Get field synonym by path- Parameters:
path
- path, can't be null- Returns:
- synonym, never null
-
getFieldsWrappers
protected Collection<IDataSetFieldsWrapper> getFieldsWrappers()
Get fields wrappers for this data set- Returns:
- collection of fields wrappers, never null
-
getParentPath
protected String getParentPath()
Get path of field parent- Returns:
- path of field parent
-
getFieldByPath
protected DataSetField getFieldByPath(String path)
Get field by path- Parameters:
path
- field path, can't be null- Returns:
- field or null if field not found
-
-