Package org.hibernate.validator.internal.engine.groups

Examples of org.hibernate.validator.internal.engine.groups.Group


    private void findMatchingDescriptors(Set<ConstraintDescriptor<?>> matchingDescriptors) {
      if ( !groups.isEmpty() ) {
        ValidationOrder validationOrder = new ValidationOrderGenerator().getValidationOrder( groups );
        Iterator<Group> groupIterator = validationOrder.getGroupIterator();
        while ( groupIterator.hasNext() ) {
          Group g = groupIterator.next();
          addMatchingDescriptorsForGroup( g.getDefiningClass(), matchingDescriptors );
        }
      }
      else {
        for ( ConstraintDescriptorImpl<?> descriptor : constraintDescriptors ) {
          if ( definedInSet.contains( descriptor.getDefinedOn() ) && elementTypes.contains( descriptor.getElementType() ) ) {
View Full Code Here


    // process first single groups. For these we can optimise object traversal by first running all validations on the current bean
    // before traversing the object.
    Iterator<Group> groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getDefiningClass() );
      validateConstraintsForCurrentGroup( context, valueContext );
      if ( shouldFailFast( context ) ) {
        return context.getFailingConstraints();
      }
    }
    groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getDefiningClass() );
      validateCascadedConstraints( context, valueContext );
      if ( shouldFailFast( context ) ) {
        return context.getFailingConstraints();
      }
    }

    // now we process sequences. For sequences I have to traverse the object graph since I have to stop processing when an error occurs.
    Iterator<Sequence> sequenceIterator = validationOrder.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      Sequence sequence = sequenceIterator.next();
      for ( Group group : sequence.getComposingGroups() ) {
        int numberOfViolations = context.getFailingConstraints().size();
        valueContext.setCurrentGroup( group.getDefiningClass() );

        validateConstraintsForCurrentGroup( context, valueContext );
        if ( shouldFailFast( context ) ) {
          return context.getFailingConstraints();
        }
View Full Code Here

    assertDefaultGroupSequenceIsExpandable( valueContext, validationOrder );

    // process first single groups
    Iterator<Group> groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getDefiningClass() );
      validatePropertyForCurrentGroup( valueContext, context, metaConstraints );
      if ( shouldFailFast( context ) ) {
        return context.getFailingConstraints();
      }
    }

    // now process sequences, stop after the first erroneous group
    Iterator<Sequence> sequenceIterator = validationOrder.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      Sequence sequence = sequenceIterator.next();
      for ( Group group : sequence.getComposingGroups() ) {
        valueContext.setCurrentGroup( group.getDefiningClass() );
        int numberOfConstraintViolations = validatePropertyForCurrentGroup(
            valueContext, context, metaConstraints
        );
        if ( shouldFailFast( context ) ) {
          return context.getFailingConstraints();
View Full Code Here

    }

    // process first single groups
    Iterator<Group> groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getDefiningClass() );
      validatePropertyForCurrentGroup( valueContext, context, metaConstraints );
      if ( shouldFailFast( context ) ) {
        return context.getFailingConstraints();
      }
    }

    // now process sequences, stop after the first erroneous group
    Iterator<Sequence> sequenceIterator = validationOrder.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      Sequence sequence = sequenceIterator.next();
      for ( Group group : sequence.getComposingGroups() ) {
        valueContext.setCurrentGroup( group.getDefiningClass() );
        int numberOfConstraintViolations = validatePropertyForCurrentGroup(
            valueContext, context, metaConstraints
        );
        if ( shouldFailFast( context ) ) {
          return context.getFailingConstraints();
View Full Code Here

        PathImpl.createPathForExecutable( executableMetaData )
    );

    groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      cascadingValueContext.setCurrentGroup( group.getDefiningClass() );
      validateCascadedConstraints( validationContext, cascadingValueContext );
      if ( shouldFailFast( validationContext ) ) {
        return;
      }
    }

    // now process sequences, stop after the first erroneous group
    Iterator<Sequence> sequenceIterator = validationOrder.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      Sequence sequence = sequenceIterator.next();
      for ( Group group : sequence.getComposingGroups() ) {
        int numberOfFailingConstraint = validateParametersForGroup(
            validationContext, parameterValues, group
        );
        if ( shouldFailFast( validationContext ) ) {
          return;
        }

        cascadingValueContext.setCurrentGroup( group.getDefiningClass() );
        validateCascadedConstraints( validationContext, cascadingValueContext );

        if ( shouldFailFast( validationContext ) ) {
          return;
        }
View Full Code Here

          PathImpl.createPathForExecutable( executableMetaData )
      );

      groupIterator = validationOrder.getGroupIterator();
      while ( groupIterator.hasNext() ) {
        Group group = groupIterator.next();
        cascadingValueContext.setCurrentGroup( group.getDefiningClass() );
        validateCascadedConstraints( context, cascadingValueContext );
        if ( shouldFailFast( context ) ) {
          return;
        }
      }
    }

    // now process sequences, stop after the first erroneous group
    Iterator<Sequence> sequenceIterator = validationOrder.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      Sequence sequence = sequenceIterator.next();
      for ( Group group : sequence.getComposingGroups() ) {
        int numberOfFailingConstraint = validateReturnValueForGroup(
            context, bean, value, group
        );
        if ( shouldFailFast( context ) ) {
          return;
        }

        if ( value != null ) {
          cascadingValueContext.setCurrentGroup( group.getDefiningClass() );
          validateCascadedConstraints( context, cascadingValueContext );

          if ( shouldFailFast( context ) ) {
            return;
          }
View Full Code Here

    // process first single groups. For these we can optimise object traversal by first running all validations on the current bean
    // before traversing the object.
    Iterator<Group> groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getDefiningClass() );
      validateConstraintsForCurrentGroup( context, valueContext );
      if ( shouldFailFast( context ) ) {
        return context.getFailingConstraints();
      }
    }
    groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getDefiningClass() );
      validateCascadedConstraints( context, valueContext );
      if ( shouldFailFast( context ) ) {
        return context.getFailingConstraints();
      }
    }

    // now we process sequences. For sequences I have to traverse the object graph since I have to stop processing when an error occurs.
    Iterator<Sequence> sequenceIterator = validationOrder.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      Sequence sequence = sequenceIterator.next();
      for ( Group group : sequence.getComposingGroups() ) {
        int numberOfViolations = context.getFailingConstraints().size();
        valueContext.setCurrentGroup( group.getDefiningClass() );

        validateConstraintsForCurrentGroup( context, valueContext );
        if ( shouldFailFast( context ) ) {
          return context.getFailingConstraints();
        }
View Full Code Here

    assertDefaultGroupSequenceIsExpandable( valueContext, validationOrder );

    // process first single groups
    Iterator<Group> groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getDefiningClass() );
      validatePropertyForCurrentGroup( valueContext, context, metaConstraints );
      if ( shouldFailFast( context ) ) {
        return context.getFailingConstraints();
      }
    }

    // now process sequences, stop after the first erroneous group
    Iterator<Sequence> sequenceIterator = validationOrder.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      Sequence sequence = sequenceIterator.next();
      for ( Group group : sequence.getComposingGroups() ) {
        valueContext.setCurrentGroup( group.getDefiningClass() );
        int numberOfConstraintViolations = validatePropertyForCurrentGroup(
            valueContext, context, metaConstraints
        );
        if ( shouldFailFast( context ) ) {
          return context.getFailingConstraints();
View Full Code Here

    }

    // process first single groups
    Iterator<Group> groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getDefiningClass() );
      validatePropertyForCurrentGroup( valueContext, context, metaConstraints );
      if ( shouldFailFast( context ) ) {
        return context.getFailingConstraints();
      }
    }

    // now process sequences, stop after the first erroneous group
    Iterator<Sequence> sequenceIterator = validationOrder.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      Sequence sequence = sequenceIterator.next();
      for ( Group group : sequence.getComposingGroups() ) {
        valueContext.setCurrentGroup( group.getDefiningClass() );
        int numberOfConstraintViolations = validatePropertyForCurrentGroup(
            valueContext, context, metaConstraints
        );
        if ( shouldFailFast( context ) ) {
          return context.getFailingConstraints();
View Full Code Here

        PathImpl.createPathForExecutable( executableMetaData )
    );

    groupIterator = validationOrder.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      cascadingValueContext.setCurrentGroup( group.getDefiningClass() );
      validateCascadedConstraints( validationContext, cascadingValueContext );
      if ( shouldFailFast( validationContext ) ) {
        return;
      }
    }

    // now process sequences, stop after the first erroneous group
    Iterator<Sequence> sequenceIterator = validationOrder.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      Sequence sequence = sequenceIterator.next();
      for ( Group group : sequence.getComposingGroups() ) {
        int numberOfFailingConstraint = validateParametersForGroup(
            validationContext, parameterValues, group
        );
        if ( shouldFailFast( validationContext ) ) {
          return;
        }

        cascadingValueContext.setCurrentGroup( group.getDefiningClass() );
        validateCascadedConstraints( validationContext, cascadingValueContext );

        if ( shouldFailFast( validationContext ) ) {
          return;
        }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.internal.engine.groups.Group

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.