Interface ValidationProvider
-
- All Superinterfaces:
Validator
- All Known Implementing Classes:
BeanValidationProvider
,DefaultValidationProvider
,EcoreEditorPerformance_PTest.Validation
,ValidationProvider.ContextSensitive
public interface ValidationProvider extends Validator
The ValidationService calls the providers after the validation with EMF. By providing an own provider, one can extend the EMF validation by providing additional validation rules.
As of the 1.23 release, for validation that requires the current view model context, consider using a subclass of the nested
ValidationProvider.ContextSensitive
class.- Since:
- 1.5
- Author:
- Eugen Neufeld
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ValidationProvider.ContextSensitive
A context-sensitiveValidationProvider
that implements thevalidate(ViewModelContext, EObject)
method to the exclusion ofValidator.validate(EObject)
.
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
setContext(ViewModelContext context)
Initialize me in the view modelcontext
of theValidationService
to which I have been added.default void
unsetContext(ViewModelContext context)
Notify me that I have been removed from theValidationService
in the givencontext
.default java.lang.Iterable<? extends org.eclipse.emf.common.util.Diagnostic>
validate(ViewModelContext context, org.eclipse.emf.ecore.EObject object)
Validate anobject
in a view modelcontext
.
-
-
-
Method Detail
-
setContext
default void setContext(ViewModelContext context)
Initialize me in the view modelcontext
of theValidationService
to which I have been added. Note that I could be added to validation services in more than one context.- Parameters:
context
- the context of theValidationService
to which I have been added- Since:
- 1.23
-
unsetContext
default void unsetContext(ViewModelContext context)
Notify me that I have been removed from theValidationService
in the givencontext
. Note that I may still be used in validation services in other contexts.- Parameters:
context
- the context of theValidationService
from which I have been removed- Since:
- 1.23
-
validate
default java.lang.Iterable<? extends org.eclipse.emf.common.util.Diagnostic> validate(ViewModelContext context, org.eclipse.emf.ecore.EObject object)
Validate anobject
in a view modelcontext
.- Parameters:
context
- the view model context in which validation is occurringobject
- the object to validate- Returns:
- the results of validation of the
object
, ornull
if none - Since:
- 1.23
-
-