Package org.hibernate.validator.engine.groups

Examples of org.hibernate.validator.engine.groups.GroupChain


  public <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) {
    if ( object == null ) {
      throw new IllegalArgumentException( "Validation of a null object" );
    }

    GroupChain groupChain = determineGroupExecutionOrder( groups );

    GlobalExecutionContext<T> context = GlobalExecutionContext.getContextForValidate(
        object, messageInterpolator, constraintValidatorFactory, getCachingTraversableResolver()
    );
View Full Code Here


  public <T> Set<ConstraintViolation<T>> validateProperty(T object, String propertyName, Class<?>... groups) {
    if ( object == null ) {
      throw new IllegalArgumentException( "Validated object cannot be null." );
    }
    sanityCheckPropertyPath( propertyName );
    GroupChain groupChain = determineGroupExecutionOrder( groups );

    List<ConstraintViolation<T>> failingConstraintViolations = new ArrayList<ConstraintViolation<T>>();
    validateProperty(
        object, PathImpl.createPathFromString( propertyName ), failingConstraintViolations, groupChain
    );
View Full Code Here

    if ( beanType == null ) {
      throw new IllegalArgumentException( "The bean type cannot be null." );
    }

    sanityCheckPropertyPath( propertyName );
    GroupChain groupChain = determineGroupExecutionOrder( groups );

    List<ConstraintViolation<T>> failingConstraintViolations = new ArrayList<ConstraintViolation<T>>();
    validateValue(
        beanType, value, PathImpl.createPathFromString( propertyName ), failingConstraintViolations, groupChain
    );
View Full Code Here

      else if ( isIndexable ) {
        currentPath.getLeafNode().setIndex( index );
      }

      if ( !context.isAlreadyValidated( value, currentGroup, currentPath ) ) {
        GroupChain groupChain = groupChainGenerator.getGroupChainFor(
            Arrays.asList(
                new Class<?>[] {
                    currentGroup
                }
            )
View Full Code Here

      return Collections.unmodifiableSet( matchingDescriptors );
    }

    private void findMatchingDescriptors(Set<ConstraintDescriptor<?>> matchingDescriptors) {
      if ( !groups.isEmpty() ) {
        GroupChain groupChain = new GroupChainGenerator().getGroupChainFor( groups );
        Iterator<Group> groupIterator = groupChain.getGroupIterator();
        while ( groupIterator.hasNext() ) {
          Group g = groupIterator.next();
          addMatchingDescriptorsForGroup( g.getGroup(), matchingDescriptors );
        }
      }
View Full Code Here

  public final <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) {
    if ( object == null ) {
      throw new IllegalArgumentException( "Validation of a null object" );
    }

    GroupChain groupChain = determineGroupExecutionOrder( groups );

    ValidationContext<T, ConstraintViolation<T>> validationContext = ValidationContext.getContextForValidate(
        object, messageInterpolator, constraintValidatorFactory, getCachingTraversableResolver(), failFast
    );
View Full Code Here

  public final <T> Set<ConstraintViolation<T>> validateProperty(T object, String propertyName, Class<?>... groups) {
    if ( object == null ) {
      throw new IllegalArgumentException( "Validated object cannot be null." );
    }
    sanityCheckPropertyPath( propertyName );
    GroupChain groupChain = determineGroupExecutionOrder( groups );

    ValidationContext<T, ConstraintViolation<T>> context = ValidationContext.getContextForValidateProperty(
        object,
        messageInterpolator,
        constraintValidatorFactory,
View Full Code Here

    if ( beanType == null ) {
      throw new IllegalArgumentException( "The bean type cannot be null." );
    }

    sanityCheckPropertyPath( propertyName );
    GroupChain groupChain = determineGroupExecutionOrder( groups );

    ValidationContext<T, ConstraintViolation<T>> context = ValidationContext.getContextForValidateValue(
        beanType,
        messageInterpolator,
        constraintValidatorFactory,
View Full Code Here

  public final <T> Set<MethodConstraintViolation<T>> validateParameter(T object, Method method, Object parameterValue, int parameterIndex, Class<?>... groups) {

    Contracts.assertNotNull( object, "The object to be validated must not be null" );
    Contracts.assertNotNull( method, "The method to be validated must not be null" );

    GroupChain groupChain = determineGroupExecutionOrder( groups );

    MethodValidationContext<T> context = ValidationContext.getContextForValidateParameter(
        method,
        parameterIndex,
        object,
View Full Code Here

    //this might be the case for parameterless methods
    if ( parameterValues == null ) {
      return Collections.emptySet();
    }

    GroupChain groupChain = determineGroupExecutionOrder( groups );

    MethodValidationContext<T> context = ValidationContext.getContextForValidateParameters(
        method,
        object,
        messageInterpolator,
View Full Code Here

TOP

Related Classes of org.hibernate.validator.engine.groups.GroupChain

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.