Package com._1c.g5.v8.dt.ql.typesystem
Class DbViewElementSource
- java.lang.Object
-
- com._1c.g5.v8.dt.ql.typesystem.DbViewElementSource
-
public class DbViewElementSource extends Object
Type-mutableDbViewElement
source. It's used to work with type-changableDbViewElement
without the overhead of excessive cloning
-
-
Constructor Summary
Constructors Constructor Description DbViewElementSource(DbViewElement source)
Constructs an instance using provided sourceDbViewElement
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DbViewElementSource
create(DbViewElement source)
Constructs an instance of theDbViewElementSource
, null-safeorg.eclipse.emf.ecore.EObject
eContainer()
Gets the eContainer of the originalDbViewElement
org.eclipse.emf.ecore.EStructuralFeature
eContainingFeature()
Gets the eContainingFeature of the originalDbViewElement
Object
eGet(org.eclipse.emf.ecore.EStructuralFeature feature)
Gets the feature value from the originalDbViewElement
static List<DbViewElementSource>
getFieldsByTypeDescription(org.eclipse.emf.ecore.EObject context, TypeDescription typeDescription)
Returns fields provided by type description or empty list.org.eclipse.emf.ecore.EObject
getMdObject()
Gets the associatedMdObject
from the originalDbViewElement
String
getName()
Gets the name of the originalDbViewElement
String
getNameRu()
Gets the russion name variant of the originalDbViewElement
DbViewElement
getSource()
Gets the sourceDbViewElement
static void
resolve(DbViewElementSource dbView, org.eclipse.emf.ecore.EObject semanticObject)
Resolves givenDbViewElementSource
if possiblevoid
resolve(org.eclipse.emf.ecore.EObject semanticObject)
Resolves the underlying sourceDbViewElement
toDbViewElement()
Converts the source to the targetDbViewElement
.static DbViewElement
toDbViewElement(DbViewElementSource source)
Converts back to theDbViewElement
static List<DbViewElement>
toDbViewElements(Collection<? extends DbViewElementSource> sources)
Converts the collection ofDbViewElementSource
's to the correspondingDbViewElement
'sstatic List<? extends DbViewElementSource>
toSources(List<? extends DbViewElement> fields)
Converts the collection ofDbViewElement
's to the corresponding list ofDbViewElementSource
's
-
-
-
Constructor Detail
-
DbViewElementSource
public DbViewElementSource(DbViewElement source)
Constructs an instance using provided sourceDbViewElement
- Parameters:
source
- The source. May not benull
-
-
Method Detail
-
create
public static DbViewElementSource create(DbViewElement source)
Constructs an instance of theDbViewElementSource
, null-safe- Parameters:
source
- The givenDbViewElement
, may benull
- Returns:
- The constructed source or
null
if the given source isnull
-
getFieldsByTypeDescription
public static List<DbViewElementSource> getFieldsByTypeDescription(org.eclipse.emf.ecore.EObject context, TypeDescription typeDescription)
Returns fields provided by type description or empty list.- Parameters:
context
- the context object to figure out execution scopetypeDescription
- theTypeDescription
(may benull
)- Returns:
- fields from dbviews provided by field types or empty list.
-
resolve
public static void resolve(DbViewElementSource dbView, org.eclipse.emf.ecore.EObject semanticObject)
Resolves givenDbViewElementSource
if possible- Parameters:
dbView
- TheDbViewElementSource
to resolve. May benull
semanticObject
- The object to use as a resolution context. May not benull
-
toDbViewElement
public static DbViewElement toDbViewElement(DbViewElementSource source)
Converts back to theDbViewElement
- Parameters:
source
- TheDbViewElementSource
to convert. May benull
- Returns:
- The corresponding
DbViewElement
if any.null
if no source is provided
-
toDbViewElements
public static List<DbViewElement> toDbViewElements(Collection<? extends DbViewElementSource> sources)
Converts the collection ofDbViewElementSource
's to the correspondingDbViewElement
's- Parameters:
sources
- The collection of input sources. May not benull
- Returns:
- The list of corresponding
DbViewElement
's. May not benull
-
toSources
public static List<? extends DbViewElementSource> toSources(List<? extends DbViewElement> fields)
Converts the collection ofDbViewElement
's to the corresponding list ofDbViewElementSource
's- Parameters:
fields
- The collection of fields. May not benull
- Returns:
- The list of sources. Never
null
-
eContainer
public org.eclipse.emf.ecore.EObject eContainer()
Gets the eContainer of the originalDbViewElement
- Returns:
- The eContainer of the original
DbViewElement
. May be null in case of cloning
-
eContainingFeature
public org.eclipse.emf.ecore.EStructuralFeature eContainingFeature()
Gets the eContainingFeature of the originalDbViewElement
- Returns:
- The eContainingFeature of the original
DbViewElement
-
eGet
public Object eGet(org.eclipse.emf.ecore.EStructuralFeature feature)
Gets the feature value from the originalDbViewElement
- Parameters:
feature
- The feature to get value for. May not benull
- Returns:
- The value of the feature. May be
null
-
getMdObject
public org.eclipse.emf.ecore.EObject getMdObject()
Gets the associatedMdObject
from the originalDbViewElement
- Returns:
- The associated
MdObject
. May benull
-
getName
public String getName()
Gets the name of the originalDbViewElement
- Returns:
- The name if present. May be
null
-
getNameRu
public String getNameRu()
Gets the russion name variant of the originalDbViewElement
- Returns:
- The name if present. May be
null
-
getSource
public DbViewElement getSource()
Gets the sourceDbViewElement
- Returns:
- The source
DbViewElement
. May not benull
-
resolve
public void resolve(org.eclipse.emf.ecore.EObject semanticObject)
Resolves the underlying source- Parameters:
semanticObject
- The context object to use during the resoltion. May not benull
-
toDbViewElement
public DbViewElement toDbViewElement()
Converts the source to the targetDbViewElement
. Depending on the scenario it can be the originalDbViewElement
or it's copy- Returns:
- The target
DbViewElement
. May not benull
-
-