Examples of ExecutableConstraintLocation


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

    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 ) );
  }
View Full Code Here

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

  }

  public ConstrainedParameter build(ConstraintHelper constraintHelper, ParameterNameProvider parameterNameProvider) {
    return new ConstrainedParameter(
        ConfigurationSource.API,
        new ExecutableConstraintLocation( executableContext.getExecutable(), parameterIndex ),
        executableContext.getExecutable().getParameterNames( parameterNameProvider ).get( parameterIndex ),
        getConstraints( constraintHelper ),
        groupConversions,
        isCascading
    );
View Full Code Here

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

    );
  }

  public static <A extends Annotation> ConfiguredConstraint<A, ExecutableConstraintLocation> forParameter(ConstraintDef<?, A> constraint, ExecutableElement executable, int parameterIndex) {
    return new ConfiguredConstraint<A, ExecutableConstraintLocation>(
        constraint, new ExecutableConstraintLocation( executable, parameterIndex )
    );
  }
View Full Code Here

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

    );
  }

  public static <A extends Annotation> ConfiguredConstraint<A, ExecutableConstraintLocation> forExecutable(ConstraintDef<?, A> constraint, ExecutableElement executable) {
    return new ConfiguredConstraint<A, ExecutableConstraintLocation>(
        constraint, new ExecutableConstraintLocation( executable )
    );
  }
View Full Code Here

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

      );
    }
    else {
      return new ConstrainedExecutable(
          ConfigurationSource.API,
          new ExecutableConstraintLocation( (Method) member ),
          getConstraints( constraintHelper ),
          groupConversions,
          isCascading
      );
    }
View Full Code Here

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

  }

  public ConstrainedElement build(ConstraintHelper constraintHelper, ParameterNameProvider parameterNameProvider) {
    return new ConstrainedExecutable(
        ConfigurationSource.API,
        new ExecutableConstraintLocation( executable ),
        getParameters( constraintHelper, parameterNameProvider ),
        crossParameterContext != null ? crossParameterContext.getConstraints( constraintHelper ) : Collections.<MetaConstraint<?>>emptySet(),
        returnValueContext != null ? returnValueContext.getConstraints( constraintHelper ) : Collections.<MetaConstraint<?>>emptySet(),
        returnValueContext != null ? returnValueContext.getGroupConversions() : Collections.<Class<?>, Class<?>>emptyMap(),
        returnValueContext != null ? returnValueContext.isCascading() : false
View Full Code Here

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

      }
      else {
        constrainedParameters.add(
            new ConstrainedParameter(
                ConfigurationSource.API,
                new ExecutableConstraintLocation( executable, i ),
                executable.getParameterNames( parameterNameProvider ).get( i )
            )
        );
      }
    }
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.