com.softwareag.centrasite.appl.framework.validation
Interface Constraint

All Superinterfaces:
Condition, Scope
All Known Subinterfaces:
ReadOnlyConstraint, ValidationConstraint
All Known Implementing Classes:
AbstractConstraint, DefaultReadOnlyConstraint, DefaultValidationConstraint

public interface Constraint
extends Scope, Condition

A constraint is a boolean Condition, combined with a Scope. The scope indicates, when the constraint is being applied. The condition indicates, whether the constraint is violated or not. The constraints type indicates its use.

By default, there are two types of constraints:

  1. The ReadOnlyConstraint indicates, whether an object or attribute may be modified. This may depend, for example, on authorization issues.
  2. The ValidationConstraint indicates, whether an object or attribute is valid. For example, an object may be validated before saving it by applying all of its constraints. If either of the constraints is violated, then an error message should pop up, which declines saving the object.
However, you are free to add custom constraint types: The constraint type is expressed by implementing a marker interface like ReadOnlyConstraint, or ValidationConstraint. Of course, you may add more marker interfaces.

The Scope is used to distinguish between an objects lifecycle phases. For example, an object may be writable in its development phase and read-only in production.


Nested Class Summary
static interface Constraint.Context
          The constraints context is the link between its environment and the constraints implementation.
static interface Constraint.Listener
          The constraints listener is called, if the constraint detects that its violated.
 
Method Summary
 
Methods inherited from interface com.softwareag.centrasite.appl.framework.validation.Scope
isApplicable
 
Methods inherited from interface com.softwareag.centrasite.appl.framework.validation.Condition
check