Examples of EmailDef


Examples of org.hibernate.validator.cfg.defs.EmailDef

        HibernateValidatorConfiguration configuration = Validation.byProvider(HibernateValidator.class).configure();
        Assert.assertNotNull(configuration);
        ConstraintMapping mapping = new ConstraintMapping();
        mapping.type(Employee.class).property("firstName", FIELD)
                .constraint(new EmailDef().message("Invalid Email!You have entered:--\\{${validatedValue}\\}"));

        final MessageInterpolator messageInterpolator = new ValueFormatterMessageInterpolator();
        configuration.messageInterpolator(messageInterpolator);
        configuration.addMapping(mapping);
View Full Code Here

Examples of org.hibernate.validator.cfg.defs.EmailDef

    final HibernateValidatorConfiguration config = getConfiguration( HibernateValidator.class );
    ConstraintMapping mapping = config.createConstraintMapping();
    mapping.type( EmailContainer.class )
        .property( "email", METHOD )
        .constraint(
            new EmailDef().regexp( noOrgEmailAddressRegexp )
                .message( "ORG addresses are not valid" )
        );
    config.addMapping( mapping );
    validator = config.buildValidatorFactory().getValidator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.