org.eclipse.emf.validation.service
Interface IModelConstraintProvider
-
All Known Implementing Classes:
-
AbstractConstraintProvider,
XmlConstraintProvider
-
public interface IModelConstraintProvider
Interface implemented by objects that can provide
IModelConstraints to the
system for validation of EMF objects. Implementators are registered on the
org.eclipse.emf.validation.constraintProviders extension
point.
An important implementor of this interface is the
ModelValidationService
which clients use to obtain constraints that they may evaluate on an
EMF object.
This interface may be implemented by clients of the validation framework, but
for most situations, the
XmlConstraintProvider
provides all of the required behaviour.
-
See Also:
-
XmlConstraintProvider,
ModelValidationService
getBatchConstraints
Collection<
IModelConstraint> getBatchConstraints(
EObject eObject,
Collection<
IModelConstraint> constraints)
- Obtains a collection of batch
IModelConstraints
which will be used to validate an eObject on demand.
Clients typically should invoke this method on the service with a
null value for the constraints collector
parameter.
-
-
Parameters:
-
eObject - the
EObject for which constraints are to be
obtained that can be applied to it -
constraints - a collector parameter to which I will add
any constraints that I provide. If this argument is
null, then I create and return a new collection
-
Returns:
- the collection which was passed in by the
constraints parameter (with additions), or a new
collection if constraints == null
getLiveConstraints
Collection<
IModelConstraint> getLiveConstraints(
Notification notification,
Collection<
IModelConstraint> constraints)
- Obtains a collection of live
IModelConstraints
that will be used to validate an EMF notification on
committing a transaction on a model.
Clients typically should invoke this method on the service with a
null value for the constraints collector
parameter.
-
-
Parameters:
-
notification - the EMF notification that is to be validated.
Encapsulates the object and the particular change -
constraints - a collector parameter to which I will add
any constraints that I provide. If this argument is
null, then I create and return a new collection
-
Returns:
- the collection which was passed in by the
constraints parameter (with additions), or a new
collection if constraints == null