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

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.validation.impl.AbstractTypeConditionFactory
All Implemented Interfaces:
ConditionFactory
Direct Known Subclasses:
BooleanConditionFactory, CSAppConceptConditionFactory, CSAppUserConditionFactory, DateConditionFactory, IntegerConditionFactory, ListConditionFactory, StringConditionFactory

public abstract class AbstractTypeConditionFactory
extends java.lang.Object
implements ConditionFactory

An abstract base class for condition factories.


Constructor Summary
AbstractTypeConditionFactory()
           
 
Method Summary
protected  Condition getCondition(java.lang.String pType, ValidatableFactory.Context pContext, java.lang.String pErrorCode, java.lang.String[] pDescriptions)
          Called to handle the default types.
 Condition getCondition(ValidatableFactory.Context pContext, java.lang.String pErrorCode, java.lang.String[] pDescriptions)
          Creates a new condition, based on the given description.
protected  ErrorCode getErrorCode(java.lang.String pErrorCode)
          Reads the error code from the constraint.
protected  java.lang.String getParam(java.lang.String[] pDescriptions, java.lang.String pParam)
          Searches for a particular item in the list of conditions.
protected  int getParamIndex(java.lang.String[] pDescriptions, java.lang.String pParam)
          Searches for a particular item in the list of conditions.
protected  ErrorCode newErrorCode(java.lang.String pValue)
          Creates a new instance of ErrorCode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTypeConditionFactory

public AbstractTypeConditionFactory()
Method Detail

newErrorCode

protected ErrorCode newErrorCode(java.lang.String pValue)
                          throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Creates a new instance of ErrorCode.

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

getParam

protected java.lang.String getParam(java.lang.String[] pDescriptions,
                                    java.lang.String pParam)
Searches for a particular item in the list of conditions. The item is written as "foo=", with "foo" being the value of the parameter pParam.

Returns:
The value of the "foo" parameter, if any. In other words, the substring following after "foo=".

getParamIndex

protected int getParamIndex(java.lang.String[] pDescriptions,
                            java.lang.String pParam)
Searches for a particular item in the list of conditions. The item is written as "foo=", with "foo" being the value of the parameter pParam.


getErrorCode

protected ErrorCode getErrorCode(java.lang.String pErrorCode)
                          throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Reads the error code from the constraint.

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

getCondition

protected Condition getCondition(java.lang.String pType,
                                 ValidatableFactory.Context pContext,
                                 java.lang.String pErrorCode,
                                 java.lang.String[] pDescriptions)
                          throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Called to handle the default types.

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

getCondition

public Condition getCondition(ValidatableFactory.Context pContext,
                              java.lang.String pErrorCode,
                              java.lang.String[] pDescriptions)
                       throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Description copied from interface: ConditionFactory
Creates a new condition, based on the given description.

Specified by:
getCondition in interface ConditionFactory
Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException