Package org.hibernate.validator.cfg.defs

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


    // now the same test with programmatic configuration
    HibernateValidatorConfiguration config = ValidatorUtil.getConfiguration( HibernateValidator.class );
    ConstraintMapping mapping = config.createConstraintMapping();
    mapping.type( URLContainer.class )
        .property( "url", METHOD )
        .constraint( new URLDef().regexp( "^http://\\S+[\\.htm|\\.html]{1}$" ) );
    config.addMapping( mapping );
    Validator validator = config.buildValidatorFactory().getValidator();

    URLContainer container = new URLContainerNoAnnotations();
    runUrlContainerValidation( validator, container, true );
View Full Code Here


    HibernateValidatorConfiguration config = ValidatorUtil.getConfiguration( HibernateValidator.class );
    ConstraintMapping mapping = config.createConstraintMapping();
    mapping.type( URLContainer.class )
        .property( "url", METHOD )
        .constraint(
            new URLDef().regexp( "^http://\\S+[\\.htm|\\.html]{1}$" ).flags( Flag.CASE_INSENSITIVE )
        );
    config.addMapping( mapping );
    Validator validator = config.buildValidatorFactory().getValidator();

    URLContainer container = new URLContainerNoAnnotations();
View Full Code Here

TOP

Related Classes of org.hibernate.validator.cfg.defs.URLDef

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.