org.apache.tapestry.form.validator
Class Email
java.lang.Object
org.apache.tapestry.form.validator.BaseValidator
org.apache.tapestry.form.validator.Email
- All Implemented Interfaces:
- FormComponentContributor, Validator
public class Email
- extends BaseValidator
Validates that the user input, a string, is an email address (by checking it against a regular
expression).
- Since:
- 4.0
- Author:
- Howard Lewis Ship
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TLD_PATTERN
public static final String TLD_PATTERN
- See Also:
- Constant Field Values
DOMAIN_PATTERN
public static final String DOMAIN_PATTERN
- See Also:
- Constant Field Values
USERNAME_PATTERN
public static final String USERNAME_PATTERN
- See Also:
- Constant Field Values
PATTERN
public static final String PATTERN
- See Also:
- Constant Field Values
Email
public Email()
Email
public Email(String initializer)
validate
public void validate(IFormComponent field,
ValidationMessages messages,
Object object)
throws ValidatorException
- Description copied from interface:
Validator
- Invoked to validate input for the field. A
Translator
will have already converted the
submitted user input string into an object.
- Parameters:
field
- the form element component being validated, often used to determine the
user presentable name
for the field, used
in error messages.messages
- access to the pre-defined validation messages, in the appropriate localeobject
- the client-side representation of the field's data. May be null if the client did
not provide a value for the field (most Validators should check for null and
perform no check if null).
- Throws:
ValidatorException
- if the object violates the constraint represented by this Validator.
renderContribution
public void renderContribution(IMarkupWriter writer,
IRequestCycle cycle,
FormComponentContributorContext context,
IFormComponent field)
- Description copied from class:
BaseValidator
- Does nothing.
- Specified by:
renderContribution
in interface FormComponentContributor
- Overrides:
renderContribution
in class BaseValidator
- Parameters:
writer
- allows contributor to write additional attributes into the component's tagcycle
- for accessing request informationcontext
- utilities for genering messages and client-side validationfield
- the field for which contributions are being rendered
Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.