com.softwareag.centrasite.appl.framework.validation.impl
Class AbstractConstraint

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.validation.impl.AbstractConstraint
All Implemented Interfaces:
Condition, Constraint, Scope
Direct Known Subclasses:
DefaultReadOnlyConstraint, DefaultValidationConstraint

public abstract class AbstractConstraint
extends java.lang.Object
implements Constraint

Default implementation of Constraint. The constraint is built as a composition of Scope, and Condition.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.softwareag.centrasite.appl.framework.validation.Constraint
Constraint.Context, Constraint.Listener
 
Constructor Summary
AbstractConstraint(Scope pScope, Condition pCondition)
          Creates a new instance with the given condition and scope.
 
Method Summary
 void check(java.lang.Object pSource, Constraint.Context pContext, Constraint.Listener pListener)
          Called to decide on the conditions state.
 boolean isApplicable(java.lang.Object pSource, Constraint.Context pContext)
          Returns, whether a Constraint is applicable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConstraint

public AbstractConstraint(Scope pScope,
                          Condition pCondition)
Creates a new instance with the given condition and scope.

Method Detail

isApplicable

public boolean isApplicable(java.lang.Object pSource,
                            Constraint.Context pContext)
                     throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Description copied from interface: Scope
Returns, whether a Constraint is applicable.

Specified by:
isApplicable in interface Scope
Returns:
True, if the Constraint is applicable, false otherwise. In other words, true, if the Constraint is enabled, or false, if the Constraint is disabled.
Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

check

public void check(java.lang.Object pSource,
                  Constraint.Context pContext,
                  Constraint.Listener pListener)
           throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Description copied from interface: Condition
Called to decide on the conditions state. The Condition must invoke the Constraint.Listener, if it thinks that the constraint is violated.

Specified by:
check in interface Condition
Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException