## org.eclipse.emf.validation.service
Interface IModelConstraintProvider

All Known Implementing Classes:
  AbstractConstraintProvider, XmlConstraintProvider

    public interface IModelConstraintProvider

Interface implemented by objects that can provide `IModelConstraint`s 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`

Method Summary
`Collection<IModelConstraint>` `getBatchConstraints(EObject eObject, Collection<IModelConstraint> constraints)` Obtains a collection of batch `IModelConstraint`s which will be used to validate an `eObject` on demand.
`Collection<IModelConstraint>` `getLiveConstraints(Notification notification, Collection<IModelConstraint> constraints)` Obtains a collection of live `IModelConstraint`s that will be used to validate an EMF `notification` on committing a transaction on a model.

Method Detail

### getBatchConstraints

    Collection<IModelConstraint> getBatchConstraints(EObject eObject,
                                                     Collection<IModelConstraint> constraints)

  Obtains a collection of batch `IModelConstraint`s 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 `IModelConstraint`s 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`

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.