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

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.validation.impl.DefaultConstraintFactory
All Implemented Interfaces:
ConstraintFactory

public class DefaultConstraintFactory
extends java.lang.Object
implements ConstraintFactory

The default constraint factory. It is configured with the scope factory and the condition factory and delegates calls to them.


Constructor Summary
DefaultConstraintFactory()
           
 
Method Summary
 java.util.Collection<Constraint> createConstraints(ValidatableFactory.Context pContext, Constraints pConstraints)
          Creates an instance of Constraint, based on the specification given by pConstraints
protected  Condition newCondition(ValidatableFactory.Context pContext, java.lang.String pErrorCode, java.lang.String[] pCondition)
          Creates a new condition with the given specification.
protected  Constraint newConstraint(java.lang.String pType, Scope pScope, Condition pCondition)
          Creates a new Constraint, which is implemented by delegating to the given scope and condition factory.
protected  Constraint newConstraint(ValidatableFactory.Context pContext, Constraint constraint)
          Creates a new constraint, which is specified by the given annotation.
protected  Scope newScope(ValidatableFactory.Context pContext, java.lang.String pScope)
          Creates a new scope with the given specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConstraintFactory

public DefaultConstraintFactory()
Method Detail

newConstraint

protected Constraint newConstraint(java.lang.String pType,
                                   Scope pScope,
                                   Condition pCondition)
Creates a new Constraint, which is implemented by delegating to the given scope and condition factory.


newScope

protected Scope newScope(ValidatableFactory.Context pContext,
                         java.lang.String pScope)
                  throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Creates a new scope with the given specification.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

newCondition

protected Condition newCondition(ValidatableFactory.Context pContext,
                                 java.lang.String pErrorCode,
                                 java.lang.String[] pCondition)
                          throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Creates a new condition with the given specification.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

newConstraint

protected Constraint newConstraint(ValidatableFactory.Context pContext,
                                   Constraint constraint)
                            throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Creates a new constraint, which is specified by the given annotation.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

createConstraints

public java.util.Collection<Constraint> createConstraints(ValidatableFactory.Context pContext,
                                                          Constraints pConstraints)
                                                   throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Description copied from interface: ConstraintFactory
Creates an instance of Constraint, based on the specification given by pConstraints

Specified by:
createConstraints in interface ConstraintFactory
pConstraints - The constraint specifications.
Returns:
A new Constraint.
Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException - Creating the constraint failed.