Package org.hibernate.validation.engine.groups

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


    // 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

    }

    // process all groups breadth-first
    Iterator<Group> groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      context.setCurrentGroup( group.getGroup() );
      validateConstraints( context );
    }
    groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      context.setCurrentGroup( group.getGroup() );
      validateCascadedConstraints( context );
    }

    // process group sequences depth-first to guarantee that groups following a violation within a group won't get executed.
    Iterator<List<Group>> sequenceIterator = groupChain.getSequenceIterator();
    while ( sequenceIterator.hasNext() ) {
      List<Group> sequence = sequenceIterator.next();
      for ( Group group : sequence ) {
        int numberOfViolations = context.getFailingConstraints().size();
        context.setCurrentGroup( group.getGroup() );

        validateConstraints( context );
        validateCascadedConstraints( context );

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

    }


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

    }

    // process groups
    Iterator<Group> groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      validateValueForGroup(
          beanType,
          value,
          propertyIter,
          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

    //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

  public Set<ConstraintDescriptor<?>> getUnorderedConstraintDescriptorsMatchingGroups(Class<?>... groups) {
    Set<ConstraintDescriptor<?>> matchingDescriptors = new HashSet<ConstraintDescriptor<?>>();
    GroupChain groupChain = new GroupChainGenerator().getGroupChainFor( Arrays.asList( groups ) );
    Iterator<Group> groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group g = groupIterator.next();
      addMatchingDescriptorsForGroup( g.getGroup(), matchingDescriptors );
    }
    return Collections.unmodifiableSet( matchingDescriptors );
  }
View Full Code Here

TOP

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