Package com.opensymphony.xwork2.validator.validators

Examples of com.opensymphony.xwork2.validator.validators.EmailValidator


        return (action.getFieldErrors().size() == 0);
    }

    public void testCaseSensitiveViaExpression() throws Exception {
        EmailValidator validator = verifyCaseSensitive(true);
        assertTrue(validator.isCaseSensitive());

        validator = verifyCaseSensitive(false);
        assertFalse(validator.isCaseSensitive());
    }
View Full Code Here


            public boolean getEmailCaseSensitive() {
                return caseSensitive;
            }
        };

        EmailValidator validator = new EmailValidator();
        ValueStack valueStack = ActionContext.getContext().getValueStack();
        valueStack.push(action);
        validator.setValueStack(valueStack);

        validator.setCaseSensitiveExpression("${emailCaseSensitive}");

        return validator;
    }
View Full Code Here

        return validator;
    }

    public void testTrimViaExpression() throws Exception {
        EmailValidator validator = verifyTrim(true);
        assertTrue(validator.isTrimed());

        validator = verifyTrim(false);
        assertFalse(validator.isTrimed());
    }
View Full Code Here

            public boolean getTrimEmail() {
                return trim;
            }
        };

        EmailValidator validator = new EmailValidator();
        ValueStack valueStack = ActionContext.getContext().getValueStack();
        valueStack.push(action);
        validator.setValueStack(valueStack);

        validator.setTrimExpression("${trimEmail}");

        return validator;
    }
View Full Code Here

            public String getMyEmail() {
                return email;
            }
        };

        EmailValidator validator = new EmailValidator();
        validator.setValidatorContext(new DelegatingValidatorContext(action));
        validator.setFieldName("myEmail");
        validator.setDefaultMessage("invalid email");
        validator.setValueStack(ActionContext.getContext().getValueStack());
        validator.validate(action);

        return (action.getFieldErrors().size() == 0);
    }
View Full Code Here

            public String getEmailExpression() {
                return expression;
            }
        };

        EmailValidator validator = new EmailValidator();
        ValueStack valueStack = ActionContext.getContext().getValueStack();
        valueStack.push(action);
        validator.setValueStack(valueStack);

        validator.setValidatorContext(new DelegatingValidatorContext(action));
        validator.setFieldName("myEmail");
        validator.setDefaultMessage("invalid email");
        validator.setRegexExpression("${emailExpression}");

        validator.validate(action);

        return (action.getFieldErrors().size() == 0);
    }
View Full Code Here

        return (action.getFieldErrors().size() == 0);
    }

    public void testCaseSensitiveViaExpression() throws Exception {
        EmailValidator validator = verifyCaseSensitive(true);
        assertTrue(validator.isCaseSensitive());

        validator = verifyCaseSensitive(false);
        assertFalse(validator.isCaseSensitive());
    }
View Full Code Here

            public boolean getEmailCaseSensitive() {
                return caseSensitive;
            }
        };

        EmailValidator validator = new EmailValidator();
        ValueStack valueStack = ActionContext.getContext().getValueStack();
        valueStack.push(action);
        validator.setValueStack(valueStack);

        validator.setCaseSensitiveExpression("${emailCaseSensitive}");

        return validator;
    }
View Full Code Here

        return validator;
    }

    public void testTrimViaExpression() throws Exception {
        EmailValidator validator = verifyTrim(true);
        assertTrue(validator.isTrimed());

        validator = verifyTrim(false);
        assertFalse(validator.isTrimed());
    }
View Full Code Here

            public boolean getTrimEmail() {
                return trim;
            }
        };

        EmailValidator validator = new EmailValidator();
        ValueStack valueStack = ActionContext.getContext().getValueStack();
        valueStack.push(action);
        validator.setValueStack(valueStack);

        validator.setTrimExpression("${trimEmail}");

        return validator;
    }
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.validator.validators.EmailValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.