org.apache.myfaces.commons.validator
Class AbstractRegExprValidator

java.lang.Object
  extended by org.apache.myfaces.commons.validator.ValidatorBase
      extended by org.apache.myfaces.commons.validator.AbstractRegExprValidator
All Implemented Interfaces:
EventListener, javax.faces.component.StateHolder, javax.faces.validator.Validator

@JSFValidator(name="mcv:validateRegExpr",
              clazz="org.apache.myfaces.commons.validator.RegExprValidator",
              tagClass="org.apache.myfaces.commons.validator.ValidateRegExprTag",
              serialuidtag="-449945949876262076L")
public abstract class AbstractRegExprValidator
extends ValidatorBase

A custom validator for reg. expr., based upons Jakarta Commons. Unless otherwise specified, all attributes accept static values or EL expressions.

Version:
$Revision: 1038270 $ $Date: 2010-11-23 13:47:30 -0500 (Tue, 23 Nov 2010) $
Author:
mwessendorf (latest modification by $Author: lu4242 $)

Field Summary
static String REGEXPR_MESSAGE_ID
          The message identifier of the FacesMessage to be created if the regex check fails.
static String VALIDATOR_ID
          The standard converter id for this converter.
 
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
 
Constructor Summary
AbstractRegExprValidator()
           
 
Method Summary
abstract  String getPattern()
          the pattern, which is the base of the validation.
abstract  String getPatternExpression()
          the pattern, which is the base of the validation.
abstract  void setPattern(String string)
           
 void validate(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, Object value)
           
 
Methods inherited from class org.apache.myfaces.commons.validator.ValidatorBase
getDetailMessage, getFacesContext, getFacesMessage, getMessage, getStringValue, getSummaryMessage, getValueExpression, isTransient, restoreAttachedState, restoreState, saveAttachedState, saveState, setDetailMessage, setMessage, setSummaryMessage, setTransient, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATOR_ID

public static final String VALIDATOR_ID

The standard converter id for this converter.

See Also:
Constant Field Values

REGEXPR_MESSAGE_ID

public static final String REGEXPR_MESSAGE_ID

The message identifier of the FacesMessage to be created if the regex check fails.

See Also:
Constant Field Values
Constructor Detail

AbstractRegExprValidator

public AbstractRegExprValidator()
Method Detail

validate

public void validate(javax.faces.context.FacesContext facesContext,
                     javax.faces.component.UIComponent uiComponent,
                     Object value)
              throws javax.faces.validator.ValidatorException
Throws:
javax.faces.validator.ValidatorException

getPattern

@JSFProperty(literalOnly=true)
public abstract String getPattern()
the pattern, which is the base of the validation. It does not allow EL expressions (jsp special case).

Returns:
the pattern, on which a value should be validated

setPattern

public abstract void setPattern(String string)
Parameters:
string - the pattern, on which a value should be validated

getPatternExpression

@JSFProperty
public abstract String getPatternExpression()
the pattern, which is the base of the validation. It allow EL expressions.

Returns:
the pattern, on which a value should be validated


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.