@Beta public class DefaultUniqueNameContext extends java.lang.Object implements INamesAreUniqueValidationHelper.Context
INamesAreUniqueValidationHelper.Context.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultUniqueNameContext.BaseContextProvider
Base class for
INamesAreUniqueValidationHelper.ContextProvider. |
static class |
DefaultUniqueNameContext.BaseGlobalContextProvider
Base class for non-local unique name validation context providers.
|
static class |
DefaultUniqueNameContext.Container
Provide a context for current
IContainer. |
static class |
DefaultUniqueNameContext.ExportedFromResource
A case sensitive validation context that ensures unique names among the exported names per single resource.
|
static class |
DefaultUniqueNameContext.Global
Provide a context for the entire index.
|
static class |
DefaultUniqueNameContext.VisibleContainers
Provide a context for all visible
containers. |
| Constructor and Description |
|---|
DefaultUniqueNameContext(IResourceDescription resourceDescription,
ISelectable validationScope,
ICaseInsensitivityHelper caseInsensitivityHelper,
org.eclipse.xtext.util.CancelIndicator cancelIndicator) |
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.xtext.util.CancelIndicator |
cancelIndicator()
The cancel-indicator that shall be used.
|
java.lang.Iterable<IEObjectDescription> |
getObjectsToValidate()
Returns the objects that should be checked for uniqueness in the context of their
INamesAreUniqueValidationHelper.Context.getValidationScope(IEObjectDescription, EClass). |
ISelectable |
getValidationScope(IEObjectDescription description,
org.eclipse.emf.ecore.EClass clusterType)
Returns an
ISelectable that can be queried for elements with a given name to find duplicates. |
boolean |
isCaseSensitive(org.eclipse.emf.ecore.EObject object,
org.eclipse.emf.ecore.EClass clusterType)
Answers whether the names in the given cluster must be treated in a case
sensistive or insensitive manner.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisUniquepublic DefaultUniqueNameContext(IResourceDescription resourceDescription, ISelectable validationScope, ICaseInsensitivityHelper caseInsensitivityHelper, org.eclipse.xtext.util.CancelIndicator cancelIndicator)
public ISelectable getValidationScope(IEObjectDescription description, org.eclipse.emf.ecore.EClass clusterType)
INamesAreUniqueValidationHelper.Context
Returns an ISelectable that can be queried for elements with a given name to find duplicates.
Depending on the type of objects that have to have unique names, different selectables may be returned. Some objects must be unique per project, others must be globally unique or only unique per file. This API allows to fine tune the scope of the validation.
getValidationScope in interface INamesAreUniqueValidationHelper.Contextdescription - the description of the validated object.clusterType - the root type of the validated type hierarchy.public boolean isCaseSensitive(org.eclipse.emf.ecore.EObject object,
org.eclipse.emf.ecore.EClass clusterType)
INamesAreUniqueValidationHelper.ContextisCaseSensitive in interface INamesAreUniqueValidationHelper.ContextICaseInsensitivityHelperpublic java.lang.Iterable<IEObjectDescription> getObjectsToValidate()
INamesAreUniqueValidationHelper.ContextINamesAreUniqueValidationHelper.Context.getValidationScope(IEObjectDescription, EClass).getObjectsToValidate in interface INamesAreUniqueValidationHelper.Contextpublic org.eclipse.xtext.util.CancelIndicator cancelIndicator()
INamesAreUniqueValidationHelper.ContextcancelIndicator in interface INamesAreUniqueValidationHelper.Context