javax.faces.validator
Class LengthValidator
java.lang.Object
javax.faces.validator.LengthValidator
- All Implemented Interfaces:
- java.util.EventListener, PartialStateHolder, StateHolder, Validator
@JSFValidator(name="f:validateLength",
bodyContent="empty",
tagClass="org.apache.myfaces.taglib.core.ValidateLengthTag")
@JSFJspProperty(name="binding",
returnType="javax.faces.validator.LengthValidator",
longDesc="A ValueExpression that evaluates to a LengthValidator.")
public class LengthValidator
- extends java.lang.Object
- implements Validator, PartialStateHolder
Creates a validator and associateds it with the nearest parent
UIComponent. When invoked, the validator ensures that values are
valid strings with a length that lies within the minimum and maximum
values specified.
Commonly associated with a h:inputText entity.
Unless otherwise specified, all attributes accept static values or EL expressions.
see Javadoc of JSF Specification
- Version:
- $Revision: 882743 $ $Date: 2009-11-20 17:28:21 -0500 (Fri, 20 Nov 2009) $
- Author:
- Manfred Geiler (latest modification by $Author: lu4242 $), Thomas Spiegl
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAXIMUM_MESSAGE_ID
public static final java.lang.String MAXIMUM_MESSAGE_ID
- See Also:
- Constant Field Values
MINIMUM_MESSAGE_ID
public static final java.lang.String MINIMUM_MESSAGE_ID
- See Also:
- Constant Field Values
VALIDATOR_ID
public static final java.lang.String VALIDATOR_ID
- See Also:
- Constant Field Values
LengthValidator
public LengthValidator()
LengthValidator
public LengthValidator(int maximum)
LengthValidator
public LengthValidator(int maximum,
int minimum)
validate
public void validate(FacesContext facesContext,
UIComponent uiComponent,
java.lang.Object value)
throws ValidatorException
- Specified by:
validate
in interface Validator
- Throws:
ValidatorException
getMaximum
@JSFProperty(deferredValueType="java.lang.Integer")
public int getMaximum()
- The largest value that should be considered valid.
setMaximum
public void setMaximum(int maximum)
getMinimum
@JSFProperty(deferredValueType="java.lang.Integer")
public int getMinimum()
- The smallest value that should be considered valid.
setMinimum
public void setMinimum(int minimum)
isTransient
public boolean isTransient()
- Specified by:
isTransient
in interface StateHolder
setTransient
public void setTransient(boolean transientValue)
- Specified by:
setTransient
in interface StateHolder
saveState
public java.lang.Object saveState(FacesContext context)
- Specified by:
saveState
in interface StateHolder
restoreState
public void restoreState(FacesContext context,
java.lang.Object state)
- Specified by:
restoreState
in interface StateHolder
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
clearInitialState
public void clearInitialState()
- Specified by:
clearInitialState
in interface PartialStateHolder
initialStateMarked
public boolean initialStateMarked()
- Specified by:
initialStateMarked
in interface PartialStateHolder
markInitialState
public void markInitialState()
- Specified by:
markInitialState
in interface PartialStateHolder
Copyright © 2010 The Apache Software Foundation. All Rights Reserved.