Package org.hibernate.validator.engine.groups

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


    //this method is at the root of validateProperty calls, share the same cachedTR
    TraversableResolver cachedResolver = getCachingTraversableResolver();

    Iterator<Group> groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      validatePropertyForGroup(
          object,
          propertyPath,
          failingConstraintViolations,
          metaConstraints,
View Full Code Here


    TraversableResolver cachedTraversableResolver = getCachingTraversableResolver();

    // process groups
    Iterator<Group> groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      validateValueForGroup(
          beanType,
          value,
          propertyPath,
          failingConstraintViolations,
View Full Code Here

    // process first single groups. For these we can skip some object traversal, by first running all validations on the current bean
    // before traversing the object.
    Iterator<Group> groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      localExecutionContext.setCurrentGroup( group.getGroup() );
      validateConstraintsForCurrentGroup( context, localExecutionContext, path );
    }
    groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      localExecutionContext.setCurrentGroup( group.getGroup() );
      validateCascadedConstraints( context, localExecutionContext, path );
    }

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

        validateConstraintsForCurrentGroup( context, localExecutionContext, path );
        validateCascadedConstraints( context, localExecutionContext, path );

        if ( context.getFailingConstraints().size() > numberOfViolations ) {
View Full Code Here

    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 );
        }
      }
      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 = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getGroup() );
      validateConstraintsForCurrentGroup( context, valueContext );
      if ( context.shouldFailFast() ) {
        return context.getFailingConstraints();
      }
    }
    groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getGroup() );
      validateCascadedConstraints( context, valueContext );
      if ( context.shouldFailFast() ) {
        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<List<Group>> sequenceIterator = groupChain.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      List<Group> sequence = sequenceIterator.next();
      for ( Group group : sequence ) {
        int numberOfViolations = context.getFailingConstraints().size();
        valueContext.setCurrentGroup( group.getGroup() );

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

    }

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

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

    }

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

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

    // process first single groups. For these we can skip some object traversal, by first running all validations on the current bean
    // before traversing the object.
    Iterator<Group> groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      localExecutionContext.setCurrentGroup( group.getGroup() );
      validateConstraintsForCurrentGroup( context, localExecutionContext, path );
    }
    groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      localExecutionContext.setCurrentGroup( group.getGroup() );
      validateCascadedConstraints( context, localExecutionContext, path );
    }

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

        validateConstraintsForCurrentGroup( context, localExecutionContext, path );
        validateCascadedConstraints( context, localExecutionContext, path );

        if ( context.getFailingConstraints().size() > numberOfViolations ) {
View Full Code Here

    //this method is at the root of validateProperty calls, share the same cachedTR
    TraversableResolver cachedResolver = getCachingTraversableResolver();

    Iterator<Group> groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      validatePropertyForGroup(
          object,
          propertyPath,
          failingConstraintViolations,
          metaConstraints,
View Full Code Here

    TraversableResolver cachedTraversableResolver = getCachingTraversableResolver();

    // process groups
    Iterator<Group> groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      validateValueForGroup(
          beanType,
          value,
          propertyPath,
          failingConstraintViolations,
View Full Code Here

TOP

Related Classes of org.hibernate.validator.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.