Package org.hibernate.validator.internal.metadata.location

Examples of org.hibernate.validator.internal.metadata.location.ConstraintLocation


                                 AnnotationProcessingOptionsImpl annotationProcessingOptions) {
    Set<ConstrainedField> constrainedFields = newHashSet();
    List<String> alreadyProcessedFieldNames = newArrayList();
    for ( FieldType fieldType : fields ) {
      Field field = findField( beanClass, fieldType.getName(), alreadyProcessedFieldNames );
      ConstraintLocation constraintLocation = ConstraintLocation.forProperty( field );
      Set<MetaConstraint<?>> metaConstraints = newHashSet();
      for ( ConstraintType constraint : fieldType.getConstraint() ) {
        MetaConstraint<?> metaConstraint = MetaConstraintBuilder.buildMetaConstraint(
            constraintLocation,
            constraint,
View Full Code Here


                                    AnnotationProcessingOptionsImpl annotationProcessingOptions) {
    List<ConstrainedParameter> constrainedParameters = newArrayList();
    int i = 0;
    List<String> parameterNames = executableElement.getParameterNames( parameterNameProvider );
    for ( ParameterType parameterType : parameterList ) {
      ConstraintLocation constraintLocation = ConstraintLocation.forParameter( executableElement, i );
      Set<MetaConstraint<?>> metaConstraints = newHashSet();
      for ( ConstraintType constraint : parameterType.getConstraint() ) {
        MetaConstraint<?> metaConstraint = MetaConstraintBuilder.buildMetaConstraint(
            constraintLocation,
            constraint,
View Full Code Here

        for ( ConstrainedElement existingConstrainedElement : existingConstrainedElements ) {
          if ( existingConstrainedElement.getLocation().getMember() != null &&
              existingConstrainedElement.getLocation().getMember().equals(
                  constrainedElement.getLocation().getMember()
              ) ) {
            ConstraintLocation location = constrainedElement.getLocation();
            throw log.getConstrainedElementConfiguredMultipleTimesException(
                location.getMember().toString()
            );
          }
        }
        existingConstrainedElements.add( constrainedElement );
      }
View Full Code Here

                                 AnnotationProcessingOptionsImpl annotationProcessingOptions) {
    Set<ConstrainedField> constrainedFields = newHashSet();
    List<String> alreadyProcessedFieldNames = newArrayList();
    for ( FieldType fieldType : fields ) {
      Field field = findField( beanClass, fieldType.getName(), alreadyProcessedFieldNames );
      ConstraintLocation constraintLocation = ConstraintLocation.forProperty( field );
      Set<MetaConstraint<?>> metaConstraints = newHashSet();
      for ( ConstraintType constraint : fieldType.getConstraint() ) {
        MetaConstraint<?> metaConstraint = MetaConstraintBuilder.buildMetaConstraint(
            constraintLocation,
            constraint,
View Full Code Here

    Set<MetaConstraint<?>> crossParameterConstraints = newHashSet();
    if ( crossParameterType == null ) {
      return crossParameterConstraints;
    }

    ConstraintLocation constraintLocation = ConstraintLocation.forCrossParameter( executableElement );

    for ( ConstraintType constraintType : crossParameterType.getConstraint() ) {
      MetaConstraint<?> metaConstraint = MetaConstraintBuilder.buildMetaConstraint(
          constraintLocation,
          constraintType,
View Full Code Here

                        AnnotationProcessingOptionsImpl annotationProcessingOptions) {
    if ( returnValueType == null ) {
      return false;
    }

    ConstraintLocation constraintLocation = ConstraintLocation.forReturnValue( executableElement );
    for ( ConstraintType constraint : returnValueType.getConstraint() ) {
      MetaConstraint<?> metaConstraint = MetaConstraintBuilder.buildMetaConstraint(
          constraintLocation,
          constraint,
          executableElement.getElementType(),
View Full Code Here

    Set<ConstrainedExecutable> constrainedExecutables = newHashSet();
    List<String> alreadyProcessedGetterNames = newArrayList();
    for ( GetterType getterType : getterList ) {
      String getterName = getterType.getName();
      Method getter = findGetter( beanClass, getterName, alreadyProcessedGetterNames );
      ConstraintLocation constraintLocation = ConstraintLocation.forProperty( getter );

      Set<MetaConstraint<?>> metaConstraints = newHashSet();
      for ( ConstraintType constraint : getterType.getConstraint() ) {
        MetaConstraint<?> metaConstraint = MetaConstraintBuilder.buildMetaConstraint(
            constraintLocation,
View Full Code Here

    if ( !groupSequence.isEmpty() ) {
      defaultSequences.put( beanClass, groupSequence );
    }

    // constraints
    ConstraintLocation constraintLocation = ConstraintLocation.forClass( beanClass );
    Set<MetaConstraint<?>> metaConstraints = newHashSet();
    for ( ConstraintType constraint : classType.getConstraint() ) {
      MetaConstraint<?> metaConstraint = MetaConstraintBuilder.buildMetaConstraint(
          constraintLocation,
          constraint,
View Full Code Here

  @TestForIssue(jiraKey = "HV-930")
  public void two_meta_constraints_for_the_same_constraint_should_be_equal() throws Exception {
    ConstraintDescriptorImpl<NotNull> constraintDescriptor1 = new ConstraintDescriptorImpl<NotNull>(
        constraintHelper, barMethod, constraintAnnotation, METHOD
    );
    ConstraintLocation location1 = ConstraintLocation.forClass( Foo.class );
    MetaConstraint<NotNull> metaConstraint1 = new MetaConstraint<NotNull>( constraintDescriptor1, location1 );


    ConstraintDescriptorImpl<NotNull> constraintDescriptor2 = new ConstraintDescriptorImpl<NotNull>(
        constraintHelper, barMethod, constraintAnnotation, METHOD
    );
    ConstraintLocation location2 = ConstraintLocation.forClass( Foo.class );
    MetaConstraint<NotNull> metaConstraint2 = new MetaConstraint<NotNull>( constraintDescriptor2, location2 );

    assertEquals(
        metaConstraint1, metaConstraint2, "Two MetaConstraint instances for the same constraint should be equal"
    );
View Full Code Here

    assertThat( createEvent.isCascading() ).isFalse();
    assertThat( createEvent.getKind() ).isEqualTo( ConstrainedElementKind.METHOD );
    assertThat( createEvent.getConstraints() ).as( "No return value constraints expected" ).isEmpty();
    assertThat( createEvent.getCrossParameterConstraints() ).hasSize( 1 );

    ConstraintLocation location = createEvent.getLocation();

    assertThat( location.getMember() ).isEqualTo(
        Calendar.class.getMethod(
            "createEvent",
            DateMidnight.class,
            DateMidnight.class
        )
View Full Code Here

TOP

Related Classes of org.hibernate.validator.internal.metadata.location.ConstraintLocation

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.