Package org.apache.bval.jsr303.groups

Examples of org.apache.bval.jsr303.groups.Groups


     * {@inheritDoc}
     */
    public ElementDescriptor.ConstraintFinder unorderedAndMatchingGroups(Class<?>... groups) {
        Set<ConstraintValidation<?>> matchingDescriptors =
              new HashSet<ConstraintValidation<?>>(constraintDescriptors.size());
        Groups groupChain = new GroupsComputer().computeGroups(groups);
        for (Group group : groupChain.getGroups()) {
            if ( group.isDefault() ) {
                // If group is default, check if it gets redefined
                List<Group> expandedDefaultGroup = metaBean.getFeature(Jsr303Features.Bean.GROUP_SEQUENCE);
                for ( Group defaultGroupMember : expandedDefaultGroup ) {
                    for (ConstraintValidation<?> descriptor : constraintDescriptors) {
View Full Code Here


      MetaBean objectMetaBean = factoryContext.getMetaBeanFinder().findForClass(objectClass);
     
      final GroupValidationContext<T> context =
          createContext(objectMetaBean, object, objectClass, groups);
      final ConstraintValidationListener<T> result = context.getListener();
      final Groups sequence = context.getGroups();
     
      // 1. process groups
      for (Group current : sequence.getGroups()) {
        context.setCurrentGroup(current);
        validateBeanNet(context);
      }
     
      // 2. process sequences
      for (List<Group> eachSeq : sequence.getSequences()) {
        for (Group current : eachSeq) {
          context.setCurrentGroup(current);
          validateBeanNet(context);
          // if one of the group process in the sequence leads to one or more validation failure,
          // the groups following in the sequence must not be processed
View Full Code Here

      if (nestedProp.isNested()) {
        context.setFixedValue(nestedProp.getValue());
      }
      if (context.getMetaProperty() == null) throw new IllegalArgumentException(
          "Unknown property " + object.getClass().getName() + "." + propertyName);
      Groups sequence = context.getGroups();
     
      // 1. process groups
      for (Group current : sequence.getGroups()) {
        context.setCurrentGroup(current);
        validatePropertyInGroup(context);
      }
     
      // 2. process sequences
      for (List<Group> eachSeq : sequence.getSequences()) {
        for (Group current : eachSeq) {
          context.setCurrentGroup(current);
          validatePropertyInGroup(context);
          /**
           * if one of the group process in the sequence leads to one or more validation failure,
View Full Code Here

          createContext(metaBean, null, beanType, groups);
      ConstraintValidationListener<T> result = context.getListener();
      context.setMetaProperty(
          getNestedProperty(metaBean, null, propertyName).getMetaProperty());
      context.setFixedValue(value);
      Groups sequence = context.getGroups();
     
      // 1. process groups
      for (Group current : sequence.getGroups()) {
        context.setCurrentGroup(current);
        validatePropertyInGroup(context);
      }
      // 2. process sequences
      for (List<Group> eachSeq : sequence.getSequences()) {
        for (Group current : eachSeq) {
          context.setCurrentGroup(current);
          validatePropertyInGroup(context);
          // if one of the group process in the sequence leads to one or more validation failure,
          // the groups following in the sequence must not be processed
View Full Code Here

        super(name);
    }

    public void setUp() throws Exception {
        super.setUp();
        groupsComputer = new GroupsComputer();
    }
View Full Code Here

     * {@inheritDoc}
     */
    public ElementDescriptor.ConstraintFinder unorderedAndMatchingGroups(Class<?>... groups) {
        Set<ConstraintValidation<?>> matchingDescriptors =
            new HashSet<ConstraintValidation<?>>(constraintDescriptors.size());
        Groups groupChain = new GroupsComputer().computeGroups(groups);
        for (Group group : groupChain.getGroups()) {
            if (group.isDefault()) {
                // If group is default, check if it gets redefined
                List<Group> expandedDefaultGroup = metaBean.getFeature(Jsr303Features.Bean.GROUP_SEQUENCE);
                for (Group defaultGroupMember : expandedDefaultGroup) {
View Full Code Here

    }

    public ElementDescriptor.ConstraintFinder unorderedAndMatchingGroups(Class<?>... groups) {
        Set<ConstraintValidation> matchingDescriptors =
              new HashSet<ConstraintValidation>(constraintDescriptors.size());
        Groups groupChain = new GroupsComputer().computeGroups(groups);
        for (Group group : groupChain.getGroups()) {
            if ( group.isDefault() ) {
                // If group is default, check if it gets redefined
                List<Group> expandedDefaultGroup = metaBean.getFeature(Jsr303Features.Bean.GROUP_SEQUENCE);
                for ( Group defaultGroupMember : expandedDefaultGroup ) {
View Full Code Here

     * {@inheritDoc}
     */
    public ElementDescriptor.ConstraintFinder unorderedAndMatchingGroups(Class<?>... groups) {
        Set<ConstraintValidation<?>> matchingDescriptors =
            new HashSet<ConstraintValidation<?>>(constraintDescriptors.size());
        Groups groupChain = new GroupsComputer().computeGroups(groups);
        for (Group group : groupChain.getGroups()) {
            if (group.isDefault()) {
                // If group is default, check if it gets redefined
                List<Group> expandedDefaultGroup = metaBean.getFeature(Jsr303Features.Bean.GROUP_SEQUENCE);
                for (Group defaultGroupMember : expandedDefaultGroup) {
View Full Code Here

                path = PathImpl.create(name);
            } else {
                path = PathImpl.copy(propertyPath);
                path.addNode(new NodeImpl(name));
            }
            return new NodeBuilderDefinedContextImpl(parent, messageTemplate, path);
        }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public void moveDown(MetaProperty prop, AccessStrategy access) {
    path.addNode(new NodeImpl(prop.getName()));
    super.moveDown(prop, access);
  }
View Full Code Here

TOP

Related Classes of org.apache.bval.jsr303.groups.Groups

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.