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 EObjects.

This interface is not intended to be implemented by clients.

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

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, isReportSuccesses, putClientData, removeConstraintFilter, setReportSuccesses
 

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).

Returns:
true if I apply both batch and live constraints; false if I apply only batch constraints (the default)

setIncludeLiveConstraints

void setIncludeLiveConstraints(boolean includeLiveConstraints)
Sets whether live constraints are to be included in validation.

Parameters:
includeLiveConstraints - whether to include live constraints
See Also:
isIncludeLiveConstraints()

getTraversalStrategy

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

Returns:
my current traversal strategy

setTraversalStrategy

void setTraversalStrategy(ITraversalStrategy strategy)
Sets my traversal strategy.

Parameters:
strategy - the new traversal strategy. Must not be null
Throws:
IllegalArgumentException - on null strategies
See Also:
getTraversalStrategy()

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 EObjects
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.