org.eclipse.xtext.validation
Class NamesAreUniqueValidator
java.lang.Object
org.eclipse.xtext.validation.AbstractInjectableValidator
org.eclipse.xtext.validation.AbstractDeclarativeValidator
org.eclipse.xtext.validation.NamesAreUniqueValidator
- All Implemented Interfaces:
- org.eclipse.emf.ecore.EValidator, ValidationMessageAcceptor
public class NamesAreUniqueValidator
- extends AbstractDeclarativeValidator
An EValidator
implementation, that can be used via ComposedChecks
generically
to validate for duplicated exported objects.
It validates only the objects, that will be publicly available via an IExportedEObjectsProvider
. Local
variables and similar objects have to be validated on their own. The INamesAreUniqueValidationHelper
provides
a convenient way to apply this kind of constraints.
- Author:
- Sebastian Zarnekow - Initial contribution and API
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.EValidator |
org.eclipse.emf.ecore.EValidator.Descriptor, org.eclipse.emf.ecore.EValidator.PatternMatcher, org.eclipse.emf.ecore.EValidator.Registry, org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider, org.eclipse.emf.ecore.EValidator.ValidationDelegate |
Fields inherited from interface org.eclipse.emf.ecore.EValidator |
MARKER, RELATED_URIS_ATTRIBUTE, URI_ATTRIBUTE |
Methods inherited from class org.eclipse.xtext.validation.AbstractDeclarativeValidator |
acceptError, acceptError, acceptInfo, acceptInfo, acceptWarning, acceptWarning, checkDone, createDiagnostic, createDiagnostic, error, error, error, error, error, error, error, getChain, getCheckMode, getContext, getCurrentMethod, getCurrentObject, getMessageAcceptor, guard, info, info, info, info, info, info, internalValidate, newInstance, setInjector, setMessageAcceptor, toDiagnosticSeverity, warning, warning, warning, warning, warning, warning, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NamesAreUniqueValidator
public NamesAreUniqueValidator()
register
public void register(EValidatorRegistrar registrar)
- Overrides:
register
in class AbstractInjectableValidator
checkUniqueNamesInResourceOf
public void checkUniqueNamesInResourceOf(org.eclipse.emf.ecore.EObject eObject)
doCheckUniqueNames
public void doCheckUniqueNames(org.eclipse.emf.ecore.resource.Resource resource,
CancelIndicator cancelIndicator)
setHelper
public void setHelper(INamesAreUniqueValidationHelper helper)
getHelper
public INamesAreUniqueValidationHelper getHelper()
setResourceServiceProviderRegistry
public void setResourceServiceProviderRegistry(IResourceServiceProvider.Registry resourceDescriptionManagerRegistry)
getResourceServiceProviderRegistry
public IResourceServiceProvider.Registry getResourceServiceProviderRegistry()