Package javax.validation

Examples of javax.validation.GroupDefinitionException


    }

    private List<Group> resolveSequence(Class<?> group, GroupSequence sequenceAnnotation,
                                        Set<Class<?>> processedSequences) {
        if (processedSequences.contains(group)) {
            throw new GroupDefinitionException("Cyclic dependency in groups definition");
        } else {
            processedSequences.add(group);
        }
        List<Group> resolvedGroupSequence = new LinkedList<Group>();
        Class<?>[] sequenceArray = sequenceAnnotation.value();
View Full Code Here


      if ( ( i == 0 && index == defaultGroupIndex - 1 ) || ( i == defaultGroupList.size() - 1 && index == defaultGroupIndex + 1 ) ) {
        // if we are at the beginning or end of he defaultGroupSequence and the matches are either directly before resp after we can continue as well,
        // since we basically have two groups
        continue;
      }
      throw new GroupDefinitionException( "Unable to expand default group list" + defaultGroupList + " into sequence " + groupList );
    }
  }
View Full Code Here

    chain.insertSequence( sequence );
  }

  private List<Group> resolveSequence(Class<?> group, List<Class<?>> processedSequences) {
    if ( processedSequences.contains( group ) ) {
      throw new GroupDefinitionException( "Cyclic dependency in groups definition" );
    }
    else {
      processedSequences.add( group );
    }
    List<Group> resolvedGroupSequence = new ArrayList<Group>();
View Full Code Here

  }

  private void addTmpSequence(List<Group> resolvedGroupSequence, List<Group> tmpSequence) {
    for ( Group tmpGroup : tmpSequence ) {
      if ( resolvedGroupSequence.contains( tmpGroup ) && resolvedGroupSequence.indexOf( tmpGroup ) < resolvedGroupSequence.size() - ) {
          throw new GroupDefinitionException( "Unable to expand group sequence." );
      }
      resolvedGroupSequence.add( tmpGroup );
    }
  }
View Full Code Here

      if ( group.getName().equals( beanClass.getName() ) ) {
        defaultGroupSequence.add( Default.class );
        groupSequenceContainsDefault = true;
      }
      else if ( group.getName().equals( Default.class.getName() ) ) {
        throw new GroupDefinitionException( "'Default.class' cannot appear in default group sequence list." );
      }
      else {
        defaultGroupSequence.add( group );
      }
    }
    if ( !groupSequenceContainsDefault ) {
      throw new GroupDefinitionException( beanClass.getName() + " must be part of the redefined default group sequence." );
    }
    if ( log.isTraceEnabled() ) {
      log.trace(
          "Members of the default group sequence for bean {} are: {}",
          beanClass.getName(),
View Full Code Here

  }

  private void addInheritedGroups(Group group, List<Group> expandedGroups) {
    for ( Class<?> inheritedGroup : group.getGroup().getInterfaces() ) {
      if ( isGroupSequence( inheritedGroup ) ) {
        throw new GroupDefinitionException(
            "Sequence definitions are not allowed as composing parts of a sequence."
        );
      }
      Group g = new Group( inheritedGroup, group.getSequence() );
      expandedGroups.add( g );
View Full Code Here

    }
  }

  private List<Group> resolveSequence(Class<?> group, List<Class<?>> processedSequences) {
    if ( processedSequences.contains( group ) ) {
      throw new GroupDefinitionException( "Cyclic dependency in groups definition" );
    }
    else {
      processedSequences.add( group );
    }
    List<Group> resolvedGroupSequence = new ArrayList<Group>();
View Full Code Here

  private void addGroups(List<Group> resolvedGroupSequence, List<Group> groups) {
    for ( Group tmpGroup : groups ) {
      if ( resolvedGroupSequence.contains( tmpGroup ) && resolvedGroupSequence.indexOf( tmpGroup ) < resolvedGroupSequence
          .size() - 1 ) {
        throw new GroupDefinitionException( "Unable to expand group sequence." );
      }
      resolvedGroupSequence.add( tmpGroup );
    }
  }
View Full Code Here

    }

    // validates that programmatic/xml definition of default group sequence or default group sequence provider
    // doesn't introduce illegal default group sequence definition.
    if ( hasDefaultGroupSequenceProvider() && this.defaultGroupSequence.size() > 1 ) {
      throw new GroupDefinitionException(
          "Default group sequence and default group sequence provider cannot be defined at the same time"
      );
    }

    // add the explicitly configured constraints
View Full Code Here

        if ( group.getName().equals( beanClass.getName() ) ) {
          validDefaultGroupSequence.add( Default.class );
          groupSequenceContainsDefault = true;
        }
        else if ( group.getName().equals( Default.class.getName() ) ) {
          throw new GroupDefinitionException( "'Default.class' cannot appear in default group sequence list." );
        }
        else {
          validDefaultGroupSequence.add( group );
        }
      }
    }
    if ( !groupSequenceContainsDefault ) {
      throw new GroupDefinitionException( beanClass.getName() + " must be part of the redefined default group sequence." );
    }
    if ( log.isTraceEnabled() ) {
      log.trace(
          "Members of the default group sequence for bean {} are: {}",
          beanClass.getName(),
View Full Code Here

TOP

Related Classes of javax.validation.GroupDefinitionException

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.