|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.openedge.baritus.validation.AbstractValidator nl.openedge.baritus.validation.AbstractFieldValidator nl.openedge.baritus.validation.impl.MaximumFieldLengthValidator
This validator checks on maximum length. If the type of the value is a String, the string length is checked. If the type of the value is a Number, the actual number is used. E.g. if property maxLength is 4, "hello" will fail, but "hi" will pass, and number 5 will fail, but 2 will pass.
Field Summary | |
static int |
NO_MAXIMUM
special value that indicates there's no maximum value to check on |
Constructor Summary | |
MaximumFieldLengthValidator()
construct with 'invalid.field.input.size' as message prefix. |
|
MaximumFieldLengthValidator(int maxLength)
Construct with maxLength. |
|
MaximumFieldLengthValidator(java.lang.String errorMessageKey)
Construct with errorMessageKey for error message keys. |
|
MaximumFieldLengthValidator(java.lang.String errorMessageKey,
int maxLength)
Construct with message prefix for error message keys and set checking on maximum length with given length of fields only. |
|
MaximumFieldLengthValidator(java.lang.String errorMessageKey,
ValidationActivationRule rule)
Construct with errorMessageKey and activation rule. |
|
MaximumFieldLengthValidator(ValidationActivationRule rule)
Construct with activation rule. |
Method Summary | |
java.lang.String |
getErrorMessageKey()
Get key of error message. |
int |
getMaxLength()
Get maximum length that is checked on. |
boolean |
isValid(org.infohazard.maverick.flow.ControllerContext cctx,
FormBeanContext formBeanContext,
java.lang.String fieldName,
java.lang.Object value)
Checks whether the provided value is less than the maximum. |
void |
setErrorMessageKey(java.lang.String string)
Set key of error message. |
void |
setMaxLength(int i)
Set maximum length that is checked on . |
Methods inherited from class nl.openedge.baritus.validation.AbstractFieldValidator |
getOverrideValue |
Methods inherited from class nl.openedge.baritus.validation.AbstractValidator |
getFieldName, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getValidationActivationRule, removeValidationActivationRule, setErrorMessage, setValidationRule |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface nl.openedge.baritus.validation.ValidationRuleDependend |
getValidationActivationRule, removeValidationActivationRule, setValidationRule |
Field Detail |
public static final int NO_MAXIMUM
Constructor Detail |
public MaximumFieldLengthValidator()
public MaximumFieldLengthValidator(java.lang.String errorMessageKey)
errorMessageKey
- public MaximumFieldLengthValidator(java.lang.String errorMessageKey, int maxLength)
errorMessageKey
- message keymaxLength
- maximum length allowed for values; use -1 for no maximumpublic MaximumFieldLengthValidator(ValidationActivationRule rule)
rule
- activation rulepublic MaximumFieldLengthValidator(java.lang.String errorMessageKey, ValidationActivationRule rule)
errorMessageKey
- error message keyrule
- activation rulepublic MaximumFieldLengthValidator(int maxLength)
maxLength
- maximum length allowed for values; use -1 for no maximumMethod Detail |
public boolean isValid(org.infohazard.maverick.flow.ControllerContext cctx, FormBeanContext formBeanContext, java.lang.String fieldName, java.lang.Object value)
cctx
- maverick contextformBeanContext
- context with bean for this currentRequestfieldName
- field name of parametervalue
- the value of this parameter
FieldValidator.isValid(org.infohazard.maverick.flow.ControllerContext, nl.openedge.baritus.FormBeanContext, java.lang.String, java.lang.Object)
public int getMaxLength()
public void setMaxLength(int i)
i
- maximum length that is checked onpublic java.lang.String getErrorMessageKey()
public void setErrorMessageKey(java.lang.String string)
string
- key of error message
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |