public interface ValidationService
EObject
s
honoring defined EValidators. Additionally custom Validator
s can be registered
i.e. if the feature set of the EValidators is insufficient.Modifier and Type | Method and Description |
---|---|
void |
addDiagnosticFilter(DiagnosticFilter diagnosticFilter)
Adds a
DiagnosticFilter to remove specific Diagnostic from the result of a
validation. |
void |
addObjectFilter(ObjectFilter objectFilter)
Adds an
ObjectFilter to skip specific EObjects during the validation. |
void |
addSubTreeFilter(SubTreeFilter subTreeFilter)
Adds a
SubTreeFilter to skip specific sub trees during the validation. |
void |
addValidator(Validator validator)
Adds a validation provider to the list of known validators.
|
void |
cancel()
Allows to cancel the current validation run (if any).
|
boolean |
isBusy()
Returns true as long as a validation is in process.
|
<Filter extends ValidationFilter> |
registerValidationFilter(Filter filter)
Deprecated.
Use addSubTreeFilter, addObjectFilter and addDiagnosticFilter instead
|
void |
registerValidationResultListener(ValidationResultListener listener)
Registers a
ValidationResultListener . |
void |
removeDiagnosticFilter(DiagnosticFilter diagnosticFilter)
Removes a
DiagnosticFilter . |
void |
removeObjectFilter(ObjectFilter objectFilter)
Removes an
ObjectFilter . |
void |
removeSubTreeFilter(SubTreeFilter subTreeFilter)
Removes a
SubTreeFilter . |
void |
removeValidator(Validator validator)
Removes a validation provider from the list of known validators.
|
void |
setSubstitutionLabelProvider(org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider substitutionLabelProvider)
Set a
EValidator.SubstitutionLabelProvider to be used for substituting labels in Diagnostic s. |
<Filter extends ValidationFilter> |
unregisterValidationFilter(Filter filter)
Deprecated.
Use removeSubTreeFilter, removeObjectFilter and removeDiagnosticFilter instead
|
void |
unregisterValidationResultListener(ValidationResultListener listener)
Unregisters a
ValidationResultListener . |
org.eclipse.emf.common.util.Diagnostic |
validate(org.eclipse.emf.ecore.EObject eObject)
Validates the given eObject.
|
Set<org.eclipse.emf.common.util.Diagnostic> |
validate(Iterator<org.eclipse.emf.ecore.EObject> eObjects)
Uses the given iterator to validate all eObjects in a collection.
|
void addValidator(Validator validator)
validator
- the Validator
to addvoid removeValidator(Validator validator)
validator
- the Validator
to remove@Deprecated <Filter extends ValidationFilter> void registerValidationFilter(Filter filter)
Filter
- an ValidationFilter
implementationfilter
- the ValidationFilter
to register@Deprecated <Filter extends ValidationFilter> void unregisterValidationFilter(Filter filter)
Filter
- an ValidationFilter
implementationfilter
- the ValidationFilter
to unregistervoid registerValidationResultListener(ValidationResultListener listener)
ValidationResultListener
.listener
- the ValidationResultListener
to registervoid unregisterValidationResultListener(ValidationResultListener listener)
ValidationResultListener
.listener
- the ValidationResultListener
to unregistervoid setSubstitutionLabelProvider(org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider substitutionLabelProvider)
EValidator.SubstitutionLabelProvider
to be used for substituting labels in Diagnostic
s.substitutionLabelProvider
- the EValidator.SubstitutionLabelProvider
to be set for this serviceEValidator.SubstitutionLabelProvider
org.eclipse.emf.common.util.Diagnostic validate(org.eclipse.emf.ecore.EObject eObject)
eObject
- the eObject to validateDiagnostic
, or null if the eObject is filtered by a ValidationFilter
Set<org.eclipse.emf.common.util.Diagnostic> validate(Iterator<org.eclipse.emf.ecore.EObject> eObjects) throws ValidationCanceledException
eObjects
- the list to validateDiagnostic
sValidationCanceledException
- in case cancel()
has been calledboolean isBusy()
validate(EObject)
.
See cancel()
to interrupt a running validation process.void cancel()
validate(EObject)
.void addSubTreeFilter(SubTreeFilter subTreeFilter)
SubTreeFilter
to skip specific sub trees during the validation. null
is ignored.subTreeFilter
- SubTreeFilter
void addObjectFilter(ObjectFilter objectFilter)
ObjectFilter
to skip specific EObjects during the validation. null
is
ignored.objectFilter
- ObjectFilter
void addDiagnosticFilter(DiagnosticFilter diagnosticFilter)
DiagnosticFilter
to remove specific Diagnostic
from the result of a
validation. null
is ignored.diagnosticFilter
- DiagnosticFilter
void removeSubTreeFilter(SubTreeFilter subTreeFilter)
SubTreeFilter
.subTreeFilter
- SubTreeFilter
void removeObjectFilter(ObjectFilter objectFilter)
ObjectFilter
.objectFilter
- ObjectFilter
void removeDiagnosticFilter(DiagnosticFilter diagnosticFilter)
DiagnosticFilter
.diagnosticFilter
- DiagnosticFilter
Copyright © 2019. All rights reserved.