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

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


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


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

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

      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

  }

  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

    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

        annotationProcessingOptions
    );

    return new ConstrainedExecutable(
        ConfigurationSource.XML,
        new ExecutableConstraintLocation( executableElement ),
        parameterMetaData,
        crossParameterConstraints,
        returnValueConstraints,
        groupConversions,
        isCascaded
View Full Code Here

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

    ExecutableConstraintLocation constraintLocation = new ExecutableConstraintLocation( executableElement );
    for ( ConstraintType constraintType : returnValueType.getConstraint() ) {
      MetaConstraint<?> metaConstraint = MetaConstraintBuilder.buildMetaConstraint(
          constraintLocation,
          constraintType,
          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 );
      ExecutableConstraintLocation constraintLocation = new ExecutableConstraintLocation( getter );

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

      for ( int i = 0; i < method.getParameterTypes().length; i++ ) {
        parameterMetaDataList.add(
            new ConstrainedParameter(
                ConfigurationSource.API,
                new ExecutableConstraintLocation( method, i ),
                parameterNames.get( 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

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

TOP

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

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.