Package org.hibernate.validator.engine.groups

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


    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


    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 );
    }
    groupIterator = groupChain.getGroupIterator();
    while ( groupIterator.hasNext() ) {
      Group group = groupIterator.next();
      valueContext.setCurrentGroup( group.getGroup() );
      validateCascadedConstraints( context, valueContext );
    }

    // 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 );
        validateCascadedConstraints( context, valueContext );

        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.