org.eclipse.emf.validation.model
Interface IModelConstraint

All Known Implementing Classes:
ModelConstraint

public interface IModelConstraint

Interface implemented by all constraint objects in the EMF model validation framework, providing the validate request.


Field Summary
static int STATUS_CODE_SUCCESS
          The status code reported in the IStatus when a constraint succeeds.
 
Method Summary
 IConstraintDescriptor getDescriptor()
          Obtains my descriptor, which provides a variety of meta-data about me.
 org.eclipse.core.runtime.IStatus validate(IValidationContext ctx)
           Validates an object in the specified context.
 

Field Detail

STATUS_CODE_SUCCESS

public static final int STATUS_CODE_SUCCESS
The status code reported in the IStatus when a constraint succeeds.

See Also:
Constant Field Values
Method Detail

validate

public org.eclipse.core.runtime.IStatus validate(IValidationContext ctx)

Validates an object in the specified context. The target of the validation operation is available from the context object.

Note that it is best to use the IValidationContext.createSuccessStatus() and IValidationContext.createFailureStatus(java.lang.Object[]) methods of the context object to create the status object returned from this method, to ensure that the status object returned is correctly handled by the validation system.

Parameters:
ctx - the validation context that provides access to the current constraint evaluation environment. The framework will never pass a null value
Returns:
the status of validation of the target object. The IStatus.getSeverity() of the record is either IStatus.OK to indicate success, or some other value to indicate that validation failed. Must not return null

getDescriptor

public IConstraintDescriptor getDescriptor()
Obtains my descriptor, which provides a variety of meta-data about me.

Returns:
my constraint descriptor

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