Package com.e1c.g5.dt.core.api.naming
Interface INamingService
-
public interface INamingService
This service provides a unified point for naming of EDT objects/resources. The following capabilities are provided:
- Converts resource URI to corresponding qualified names
- Converts filepaths to corresponding qualified names
- Converts qualified names to corresonding URIs
- Provides FQNs for related objects/external properties
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
INamingService.UriType
Type of a required URI
-
Field Summary
Fields Modifier and Type Field Description static String
SERVICE_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getDependentObjectFqnAsString(org.eclipse.emf.common.util.URI parentObjectUri, org.eclipse.emf.ecore.EClass targetEClass)
Gets the dependent object FQN using the parent object URI and EClass of a target dependent object as a reference.String
getFilePath(String qualifiedPath)
Gets file path corresponding to the given top object's FQN.String
getFilePath(org.eclipse.xtext.naming.QualifiedName qName)
Gets file path corresponding to the given top object's FQN.org.eclipse.core.runtime.IPath
getFilePath(org.eclipse.xtext.naming.QualifiedName fqn, org.eclipse.emf.ecore.EClass eClass)
Gets file path by the given top object FQN andEClass
.org.eclipse.xtext.naming.QualifiedName
getFqn(String fileName)
Gets top object's FQN corresponding to the given file name.org.eclipse.xtext.naming.QualifiedName
getFqn(org.eclipse.core.resources.IFile file)
Gets top object's FQN corresponding to the given file.org.eclipse.xtext.naming.QualifiedName
getFqn(org.eclipse.core.runtime.IPath path)
Gets top object's FQN corresponding to the given path.org.eclipse.emf.common.util.URI
getParentObjectUri(String dependentObjectFqn, String projectName)
Gets the URI of a parent object using a provided project name and an FQN of a dependent objectorg.eclipse.emf.common.util.URI
getParentObjectUri(org.eclipse.emf.common.util.URI dependentObjectUri)
Gets the parent object URI (in form of string) using the provided matching dependent object URI.String
getParentObjectUriAsString(org.eclipse.emf.common.util.URI dependentObjectUri)
Gets the parent object URI (in form of string) using the provided matching dependent object URI.String
getProjectPath(String sourceUri, boolean includeFragment)
Strips project and source parts from the URI and converts it to the string.String
getProjectPath(org.eclipse.emf.common.util.URI sourceUri, boolean includeFragment)
Strips project and source parts from the URI and converts it to the string.org.eclipse.emf.common.util.URI
toUriFromProjectPath(String projectPath, String projectName, INamingService.UriType uriType)
Converts relative project path to a speciefied type of an URI
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDependentObjectFqnAsString
String getDependentObjectFqnAsString(org.eclipse.emf.common.util.URI parentObjectUri, org.eclipse.emf.ecore.EClass targetEClass)
Gets the dependent object FQN using the parent object URI and EClass of a target dependent object as a reference. The FQN is being returned in form of dot-separated name string.- Parameters:
parentObjectUri
- The parent object URI. May not benull
. Depending on the parent object nature may be either resource or BM URItargetEClass
- The targetEClass
of a dependent object. May not benull
- Returns:
- The textual representation of an FQN. May be
null
-
getFilePath
String getFilePath(org.eclipse.xtext.naming.QualifiedName qName)
Gets file path corresponding to the given top object's FQN.- Parameters:
qName
- - QualifiedName, notnull
.- Returns:
- the path if can be resolved,
null
otherwise.
-
getFilePath
org.eclipse.core.runtime.IPath getFilePath(org.eclipse.xtext.naming.QualifiedName fqn, org.eclipse.emf.ecore.EClass eClass)
Gets file path by the given top object FQN andEClass
.- Parameters:
fqn
- the FQN, notnull
.eClass
- theEClass
, notnull
.- Returns:
- the file path or
null
.
-
getFilePath
String getFilePath(String qualifiedPath)
Gets file path corresponding to the given top object's FQN.- Parameters:
qualifiedPath
- - qualified path to resource, notnull
.- Returns:
- the path if can be resolved,
null
otherwise.
-
getFqn
org.eclipse.xtext.naming.QualifiedName getFqn(org.eclipse.core.resources.IFile file)
Gets top object's FQN corresponding to the given file.- Parameters:
file
- the file, notnull
.- Returns:
- the FQN if can be resolved,
null
otherwise.
-
getFqn
org.eclipse.xtext.naming.QualifiedName getFqn(org.eclipse.core.runtime.IPath path)
Gets top object's FQN corresponding to the given path.- Parameters:
path
- the path, notnull
.- Returns:
- the FQN if can be resolved,
null
otherwise.
-
getFqn
org.eclipse.xtext.naming.QualifiedName getFqn(String fileName)
Gets top object's FQN corresponding to the given file name.- Parameters:
fileName
- the file name, notnull
.- Returns:
- the FQN if can be resolved,
null
otherwise.
-
getParentObjectUri
org.eclipse.emf.common.util.URI getParentObjectUri(String dependentObjectFqn, String projectName)
Gets the URI of a parent object using a provided project name and an FQN of a dependent object- Parameters:
dependentObjectFqn
- Dependent object FQN. May not benull
projectName
- The name of a target project. May not benull
- Returns:
- URI of a parent object. May be
null
in case of unsupported input FQN
-
getParentObjectUri
org.eclipse.emf.common.util.URI getParentObjectUri(org.eclipse.emf.common.util.URI dependentObjectUri)
Gets the parent object URI (in form of string) using the provided matching dependent object URI. The matching should be always one to one (a single dependent object may not have multiple parents)- Parameters:
dependentObjectUri
- The dependent object URI. May not benull
- Returns:
- The textual representation of a parent object URI. May be
null
-
getParentObjectUriAsString
String getParentObjectUriAsString(org.eclipse.emf.common.util.URI dependentObjectUri)
Gets the parent object URI (in form of string) using the provided matching dependent object URI. The matching should be always one to one (a single dependent object may not have multiple parents)- Parameters:
dependentObjectUri
- The dependent object URI. May not benull
- Returns:
- The textual representation of a parent object URI. May be
null
-
getProjectPath
String getProjectPath(String sourceUri, boolean includeFragment)
Strips project and source parts from the URI and converts it to the string. Supports both resource and BM uris Input URI - platform:/resource/Конфигурация/src/CommonModules/ОбщийМодуль/Module.bsl Output path - CommonModules/ОбщийМодуль/Module.bsl- Parameters:
sourceUri
- URI of the EDT resource or BM object. May not benull
-
getProjectPath
String getProjectPath(org.eclipse.emf.common.util.URI sourceUri, boolean includeFragment)
Strips project and source parts from the URI and converts it to the string. Supports both resource and BM uris Input URI - platform:/resource/Конфигурация/src/CommonModules/ОбщийМодуль/Module.bsl Output path - CommonModules/ОбщийМодуль/Module.bsl- Parameters:
sourceUri
- URI of the EDT resource or BM object. May not benull
-
toUriFromProjectPath
org.eclipse.emf.common.util.URI toUriFromProjectPath(String projectPath, String projectName, INamingService.UriType uriType)
Converts relative project path to a speciefied type of an URI- Parameters:
projectPath
- The project path. May not benull
projectName
- The name of the project. May not benull
uriType
- The type of a required URI. May not benull
- Returns:
- A target URI. May not be
null
-
-