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

All Superinterfaces:
  IValidator<EObject>

    public interface IBatchValidator

extends IValidator<EObject>

An `IValidator` that supports batch-mode validation of `EObject`s.

This interface is not intended to be implemented by clients.

See Also:
  `ModelValidationService.newValidator(EvaluationMode)`, `EvaluationMode.BATCH`

Nested Class Summary

Nested classes/interfaces inherited from interface org.eclipse.emf.validation.service.IValidator
`IValidator.Option<V>`

Field Summary
`static IValidator.Option<Boolean>` `OPTION_INCLUDE_LIVE_CONSTRAINTS` A boolean-valued option indicating whether to include live constraints in a batch validation.
`static IValidator.Option<Boolean>` `OPTION_TRACK_RESOURCES` A boolean-valued option indicating whether to include include, in the validation result, marker statuses for the resources covered by the validation operation.
`static IValidator.Option<ITraversalStrategy>` `OPTION_TRAVERSAL_STRATEGY` An option specifying an implementation of the `ITraversalStrategy` interface to be used to walk the model being validated.

Fields inherited from interface org.eclipse.emf.validation.service.IValidator
`OPTION_REPORT_SUCCESSES`

Method Summary
`ITraversalStrategy` `getDefaultTraversalStrategy()` Obtains the default traversal strategy, which can be assigned to me to `restore` the default behavior of recursive validation.
`ITraversalStrategy` `getTraversalStrategy()` Obtains the traversal strategy that I employ to walk the model starting from the elements selected by the client.
`boolean` `isIncludeLiveConstraints()` Queries whether I also evaluate applicable live constraints on each object that I validate.
`void` `setIncludeLiveConstraints(boolean includeLiveConstraints)` Sets whether live constraints are to be included in validation.
`void` `setTraversalStrategy(ITraversalStrategy strategy)` Sets my traversal strategy.
`IStatus` `validate(Collection<? extends EObject> objects)` Validates multiple `EMF elements` without using any progress monitor.
`IStatus` `validate(Collection<? extends EObject> eObjects, IProgressMonitor monitor)` Validates the specified `EMF elements`, using the specified progress monitor to monitor progress of validation.
`IStatus` `validate(EObject eobject)` Validates a single `EMF element` without using any progress monitor.
`IStatus` `validate(EObject eObject, IProgressMonitor monitor)` Validates the specified `EMF element`, using the specified progress `monitor` to monitor progress of validation (which is especially useful for recursive validation).

Methods inherited from interface org.eclipse.emf.validation.service.IValidator
`addConstraintFilter, getClientData, getConstraintFilters, getEvaluationMode, getOption, getOptions, isReportSuccesses, putClientData, removeConstraintFilter, setOption, setOptions, setReportSuccesses`

Field Detail

### OPTION_INCLUDE_LIVE_CONSTRAINTS

    static final IValidator.Option<Boolean> OPTION_INCLUDE_LIVE_CONSTRAINTS

  A boolean-valued option indicating whether to include live constraints in a batch validation. The default value is `false`.

  Since:
    1.3
  See Also:
    `IValidator.setOptions(Map)`

### OPTION_TRAVERSAL_STRATEGY

    static final IValidator.Option<ITraversalStrategy> OPTION_TRAVERSAL_STRATEGY

  An option specifying an implementation of the `ITraversalStrategy` interface to be used to walk the model being validated. The default value of this option is a traversal strategy that delegates to strategy objects registered on the `org.eclipse.emf.validation.traversal` extension point.

  Since:
    1.3
  See Also:
    `IValidator.setOptions(Map)`

### OPTION_TRACK_RESOURCES

    static final IValidator.Option<Boolean> OPTION_TRACK_RESOURCES

  A boolean-valued option indicating whether to include include, in the validation result, marker statuses for the resources covered by the validation operation. This is required when using the `MarkerUtil` to update the problem markers attached to resources. This is optional because of the increased cost (in time efficiency) of determining the resources. The default value of this option is `false`.

  Since:
    1.3
  See Also:
    `IValidator.setOptions(Map)`

Method Detail

### isIncludeLiveConstraints

    boolean isIncludeLiveConstraints()

  Queries whether I also evaluate applicable live constraints on each object that I validate. This supports those clients that do not implement a transaction model for which live validation would be appropriate, but which still need to ensure that vital data integrity and other live constraints are satisfied by their models.

  By default, I only apply batch constraints (not live constraints).

  Since the 1.3 release, this method is equivalent to checking whether the `OPTION_INCLUDE_LIVE_CONSTRAINTS` validation option is applied.

  Returns:
    `true` if I apply both batch and live constraints; `false` if I apply only batch constraints (the default)
  See Also:
    `IValidator.getOptions()`, `OPTION_INCLUDE_LIVE_CONSTRAINTS`

### setIncludeLiveConstraints

    void setIncludeLiveConstraints(boolean includeLiveConstraints)

  Sets whether live constraints are to be included in validation.

  Since the 1.3 release, this method is equivalent to applying the `IValidator.OPTION_REPORT_SUCCESSES` validation option.

  Parameters:
    `includeLiveConstraints` - whether to include live constraints
  See Also:
    `isIncludeLiveConstraints()`, `IValidator.setOptions(java.util.Map)`, `OPTION_INCLUDE_LIVE_CONSTRAINTS`

### getTraversalStrategy

    ITraversalStrategy getTraversalStrategy()

  Obtains the traversal strategy that I employ to walk the model starting from the elements selected by the client.

  Since the 1.3 release, this method is equivalent to obtaining the value of the `OPTION_TRAVERSAL_STRATEGY` validation option.

  Returns:
    my current traversal strategy
  See Also:
    `IValidator.getOptions()`, `OPTION_TRAVERSAL_STRATEGY`

### setTraversalStrategy

    void setTraversalStrategy(ITraversalStrategy strategy)

  Sets my traversal strategy.

  Since the 1.3 release, this method is equivalent to applying the `OPTION_TRAVERSAL_STRATEGY` validation option.

  Parameters:
    `strategy` - the new traversal strategy. Must not be `null`
  Throws:
    `IllegalArgumentException` - on `null` strategies
  See Also:
    `getTraversalStrategy()`, `IValidator.setOptions(java.util.Map)`, `OPTION_TRAVERSAL_STRATEGY`

### getDefaultTraversalStrategy

    ITraversalStrategy getDefaultTraversalStrategy()

  Obtains the default traversal strategy, which can be assigned to me to `restore` the default behavior of recursive validation. The default strategy makes use of all available customized `ITraversalStrategy` implementations contributed by plug-ins for iteration of the model sub-trees selected for recursive validation. This is different from the `ITraversalStrategy.Recursive` strategy, which simply iterates the entire contents of a model subtree.

  Returns:
    the default traversal strategy
  See Also:
    `setTraversalStrategy(org.eclipse.emf.validation.service.ITraversalStrategy)`

### validate

    IStatus validate(EObject eObject,
                     IProgressMonitor monitor)

  Validates the specified `EMF element`, using the specified progress `monitor` to monitor progress of validation (which is especially useful for recursive validation).

  Parameters:
    `eObject` - the EMF element to validate
    `monitor` - the progress monitor to track validation progress, or `null` if no progress monitoring is required
  Returns:
    the validation status
  See Also:
    `IValidator.validate(Object)`

### validate

    IStatus validate(Collection<? extends EObject> eObjects,
                     IProgressMonitor monitor)

  Validates the specified `EMF elements`, using the specified progress monitor to monitor progress of validation.

  Parameters:
    `eObjects` - the EMF elements to validate
    `monitor` - the progress monitor to track validation progress, or `null` if no progress monitoring is required
  Returns:
    the validation status
  See Also:
    `IValidator.validate(Object)`

### validate

    IStatus validate(EObject eobject)

  Validates a single `EMF element` without using any progress monitor.

  Specified by:
    `validate` in interface `IValidator<EObject>`
  Parameters:
    `object` - the object to validate
  Returns:
    the status of validation. The `severity` of the result indicates whether validation passed or (how badly it) failed. Normally, the result is a `multi-status` whose children are the results of individual constraint evaluations

### validate

    IStatus validate(Collection<? extends EObject> objects)

  Validates multiple `EMF elements` without using any progress monitor.

  Specified by:
    `validate` in interface `IValidator<EObject>`
  Parameters:
    `objects` - must all be `EObject`s
  Returns:
    a collective status of the validation operation, which usually is a `multi-status` of individual results
  Throws:
    `ClassCastException` - if any of the `objects` is not an `EObject`
  See Also:
    `IValidator.validate(Object)`

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