Examples of ExecutableConstraintLocation


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

      }

      metaData.add(
          new ConstrainedParameter(
              ConfigurationSource.ANNOTATION,
              new ExecutableConstraintLocation( executable, i ),
              parameterName,
              constraintsOfOneParameter,
              getGroupConversions( groupConversion, groupConversionList ),
              parameterIsCascading
          )
View Full Code Here

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

  private <A extends Annotation> MetaConstraint<?> createMetaConstraint(Member member, ConstraintDescriptorImpl<A> descriptor) {
    return new MetaConstraint<A>( descriptor, new BeanConstraintLocation( member ) );
  }

  private <A extends Annotation> MetaConstraint<A> createParameterMetaConstraint(ExecutableElement member, int parameterIndex, ConstraintDescriptorImpl<A> descriptor) {
    return new MetaConstraint<A>( descriptor, new ExecutableConstraintLocation( member, parameterIndex ) );
  }
View Full Code Here

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

  private <A extends Annotation> MetaConstraint<A> createParameterMetaConstraint(ExecutableElement member, int parameterIndex, ConstraintDescriptorImpl<A> descriptor) {
    return new MetaConstraint<A>( descriptor, new ExecutableConstraintLocation( member, parameterIndex ) );
  }

  private <A extends Annotation> MetaConstraint<A> createReturnValueMetaConstraint(ExecutableElement member, ConstraintDescriptorImpl<A> descriptor) {
    return new MetaConstraint<A>( descriptor, new ExecutableConstraintLocation( member, null ) );
  }
View Full Code Here

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

  public PropertyConstraintMappingContext valid() {
    if ( member instanceof Field ) {
      mapping.addCascadeConfig( new BeanConstraintLocation( member ) );
    }
    else {
      mapping.addMethodCascadeConfig( new ExecutableConstraintLocation( (Method) member ) );
    }

    return this;
  }
View Full Code Here

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

      }
      else if ( oneConfiguredLocation.getElementType() == ElementType.METHOD ) {
        propertyMetaData.add(
            new ConstrainedExecutable(
                ConfigurationSource.XML,
                new ExecutableConstraintLocation( (Method) oneConfiguredLocation.getMember() ),
                constraintsByLocation.get( oneConfiguredLocation ),
                cascades.contains( oneConfiguredLocation )
            )
        );
      }
View Full Code Here

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

   * Marks the current property as cascadable.
   *
   * @return Returns itself for method chaining.
   */
  public ReturnValueConstraintMappingContext valid() {
    mapping.addMethodCascadeConfig( new ExecutableConstraintLocation( method ) );
    return this;
  }
View Full Code Here

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

      for ( int i = 0; i < method.getParameterTypes().length; i++ ) {
        parameterMetaDataList.add(
            new ConstrainedParameter(
                ConfigurationSource.API,
                new ExecutableConstraintLocation( method, i ),
                parameterNames[i],
                asMetaConstraints( constraintsByParameter.get( i ) ),
                Collections.<Class<?>, Class<?>>emptyMap(),
                cascadesByParameter.containsKey( i )
            )
        );
      }

      ConstrainedExecutable methodMetaData = new ConstrainedExecutable(
          ConfigurationSource.API,
          new ExecutableConstraintLocation( method ),
          parameterMetaDataList,
          Collections.<MetaConstraint<?>>emptySet(),
          asMetaConstraints( constraintsByParameter.get( null ) ),
          Collections.<Class<?>, Class<?>>emptyMap(),
          cascadesByParameter.containsKey( null )
View Full Code Here

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

      isCascading = executable.getAccessibleObject().isAnnotationPresent( Valid.class );
    }

    return new ConstrainedExecutable(
        ConfigurationSource.ANNOTATION,
        new ExecutableConstraintLocation( executable ),
        parameterConstraints,
        crossParameterConstraints,
        returnValueConstraints,
        groupConversions,
        isCascading
View Full Code Here

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

      if ( annotationProcessingOptions.areParameterConstraintsIgnoredFor( executable.getMember(), i ) ) {
        metaData.add(
            new ConstrainedParameter(
                ConfigurationSource.ANNOTATION,
                new ExecutableConstraintLocation( executable, i ),
                parameterName,
                parameterConstraints,
                getGroupConversions( groupConversion, groupConversionList ),
                false
            )
        );
        i++;
        continue;
      }

      for ( Annotation parameterAnnotation : parameterAnnotations ) {
        //1. collect constraints if this annotation is a constraint annotation
        List<ConstraintDescriptorImpl<?>> constraints = findConstraintAnnotations(
            executable.getMember(), parameterAnnotation, ElementType.PARAMETER
        );
        for ( ConstraintDescriptorImpl<?> constraintDescriptorImpl : constraints ) {
          parameterConstraints.add(
              createParameterMetaConstraint(
                  executable, i, constraintDescriptorImpl
              )
          );
        }

        //2. mark parameter as cascading if this annotation is the @Valid annotation
        if ( parameterAnnotation.annotationType().equals( Valid.class ) ) {
          parameterIsCascading = true;
        }
        //3. determine group conversions
        else if ( parameterAnnotation.annotationType().equals( ConvertGroup.class ) ) {
          groupConversion = (ConvertGroup) parameterAnnotation;
        }
        else if ( parameterAnnotation.annotationType().equals( ConvertGroup.List.class ) ) {
          groupConversionList = (ConvertGroup.List) parameterAnnotation;
        }
      }

      metaData.add(
          new ConstrainedParameter(
              ConfigurationSource.ANNOTATION,
              new ExecutableConstraintLocation( executable, i ),
              parameterName,
              parameterConstraints,
              getGroupConversions( groupConversion, groupConversionList ),
              parameterIsCascading
          )
View Full Code Here

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

  }

  private <A extends Annotation> MetaConstraint<A> createParameterMetaConstraint(ExecutableElement member,
                                           int parameterIndex,
                                           ConstraintDescriptorImpl<A> descriptor) {
    return new MetaConstraint<A>( descriptor, new ExecutableConstraintLocation( member, parameterIndex ) );
  }
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.