Class BaseValidator

java.lang.Object
com.webmethods.caf.faces.validator.BaseValidator
All Implemented Interfaces:
EventListener, StateHolder, Validator
Direct Known Subclasses:
BaseFormattedNumberValidator, CreditCardValidator, EmailValidator, EqualValidator, ExactRegExp, FileValidator, FormattedDateRange, MwsUrlValidator, OneOfValidator, RegExpValidator

public class BaseValidator extends Object implements Validator, StateHolder
Created by IntelliJ IDEA. Date: Jan 3, 2006 Time: 6:01:33 PM To change this template use File | Settings | File Templates.
  • Field Details

  • Constructor Details

    • BaseValidator

      public BaseValidator()
  • Method Details

    • validate

      public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
      Specified by:
      validate in interface Validator
      Throws:
      ValidatorException
    • setRegion

      public void setRegion(String region)
      setRegion Set the locale for the validated to use.
      Parameters:
      region - the local object to use. Null will make the locale use the session's locale.
    • getRegionAsString

      protected String getRegionAsString()
      getRegion Set the locale for the validated to use. returns the Locale.toString(). the Construct a locale from a language code. Null or spaces will make the locale use the session's locale. also see java.util.Locale
    • getClientLocale

      protected Locale getClientLocale(FacesContext context)
      getRegion Set the locale for the validated to use. returns the Locale.toString(). the Construct a locale from a language code. Null or spaces will make the locale use the session's locale. also see java.util.Locale
    • isStringObj

      public boolean isStringObj(Object obj)
      isStringObj will check the class and see if the string is not just full of spaces.
      Parameters:
      obj -
      Returns:
      true if the object is a non-empty string, false otherwise
    • isValue

      public boolean isValue(String sValue)
    • setCustomErrorMsg

      public void setCustomErrorMsg(String sMsg)
      setCustomMsg Set a localized massage used if the convervion fails.
      Parameters:
      sMsg - message to display for conversion errors.
    • getCustomErrorMsg

      public String getCustomErrorMsg()
      getCustomMsg get the user defined message for a convervion failure.
      Returns:
      String user defined error message.
    • setshowCAFErrorMsg

      public void setshowCAFErrorMsg(boolean bShow)
      Show the exception cause if availible.
      Parameters:
      bShow - exception cause if availible.
    • getshowCAFErrorMsg

      public boolean getshowCAFErrorMsg()
      Show the exception cause if availible.
      Returns:
      boolean show exception if availible.
    • saveState

      public Object saveState(FacesContext context)
      Specified by:
      saveState in interface StateHolder
    • restoreState

      public void restoreState(FacesContext context, Object state)
      Specified by:
      restoreState in interface StateHolder
    • isTransient

      public boolean isTransient()
      Specified by:
      isTransient in interface StateHolder
    • setTransient

      public void setTransient(boolean t)
      Specified by:
      setTransient in interface StateHolder