Examples of findConstraints()


Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
    assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), AssertTrue.class );

    propertyDescriptor = descriptor.getConstraintsForProperty( "size" );
    descriptorsForGroup = propertyDescriptor.findConstraints()
        .unorderedAndMatchingGroups( All.class )
        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
    assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), Max.class );
  }
View Full Code Here

Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

    {
      PropertyDescriptor propDesc = beanDesc.getConstraintsForProperty(property.getName());
      if (propDesc != null)
      {
        // TODO use hasConstraintDesc to optimize...?
        Set<ConstraintDescriptor<?>> constraints = propDesc.findConstraints()
          .unorderedAndMatchingGroups(groups)
          .getConstraintDescriptors();
        if (constraints != null)
        {
          stack.add(constraints.iterator());
View Full Code Here

Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

  }

  private boolean isGetterConstrained(Method method, BeanDescriptor beanDescriptor) {
    String propertyName = ReflectionHelper.getPropertyName( method );
    PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty( propertyName );
    return propertyDescriptor != null && propertyDescriptor.findConstraints()
        .declaredOn( ElementType.METHOD )
        .hasConstraints();
  }

  private boolean veto(EnumSet<ExecutableType> classLevelExecutableTypes,
View Full Code Here

Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

    Validator validator = TestUtil.getValidatorUnderTest();
    BeanDescriptor descriptor = validator.getConstraintsForClass( MiniaturePart.class );

    //  PreManufacturing belongs implicitly to All
    PropertyDescriptor propertyDescriptor = descriptor.getConstraintsForProperty( "partNumber" );
    Set<ConstraintDescriptor<?>> descriptorsForGroup = propertyDescriptor.findConstraints()
        .unorderedAndMatchingGroups( All.class )
        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
    assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), Digits.class );
View Full Code Here

Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
    assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), Digits.class );

    //  PostManufacturing belongs implicitly to All
    propertyDescriptor = descriptor.getConstraintsForProperty( "qaChecked" );
    descriptorsForGroup = propertyDescriptor.findConstraints()
        .unorderedAndMatchingGroups( All.class )
        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
        assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), AssertTrue.class );
View Full Code Here

Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
        assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), AssertTrue.class );

    propertyDescriptor = descriptor.getConstraintsForProperty( "size" );
    descriptorsForGroup = propertyDescriptor.findConstraints()
        .unorderedAndMatchingGroups( All.class )
        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
    assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), Max.class );
  }
View Full Code Here

Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

    Validator validator = TestUtil.getValidatorUnderTest();
    BeanDescriptor descriptor = validator.getConstraintsForClass( MiniaturePart.class );

    //  PreManufacturing belongs implicitly to All
    PropertyDescriptor propertyDescriptor = descriptor.getConstraintsForProperty( "partNumber" );
    Set<ConstraintDescriptor<?>> descriptorsForGroup = propertyDescriptor.findConstraints()
        .unorderedAndMatchingGroups( All.class )
        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
    assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), Digits.class );
View Full Code Here

Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
    assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), Digits.class );

    //  PostManufacturing belongs implicitly to All
    propertyDescriptor = descriptor.getConstraintsForProperty( "qaChecked" );
    descriptorsForGroup = propertyDescriptor.findConstraints()
        .unorderedAndMatchingGroups( All.class )
        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
        assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), AssertTrue.class );
View Full Code Here

Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
        assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), AssertTrue.class );

    propertyDescriptor = descriptor.getConstraintsForProperty( "size" );
    descriptorsForGroup = propertyDescriptor.findConstraints()
        .unorderedAndMatchingGroups( All.class )
        .getConstraintDescriptors();
    assertEquals( descriptorsForGroup.size(), 1, "Wrong number of descriptors" );
    assertEquals( descriptorsForGroup.iterator().next().getAnnotation().annotationType(), Max.class );
  }
View Full Code Here

Examples of javax.validation.metadata.PropertyDescriptor.findConstraints()

  }

  private boolean isGetterConstrained(Method method, BeanDescriptor beanDescriptor) {
    String propertyName = ReflectionHelper.getPropertyName( method );
    PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty( propertyName );
    return propertyDescriptor != null && propertyDescriptor.findConstraints()
        .declaredOn( ElementType.METHOD )
        .hasConstraints();
  }

  private boolean veto(EnumSet<ExecutableType> classLevelExecutableTypes,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.