Package org.hibernate.validator.internal.metadata.raw

Examples of org.hibernate.validator.internal.metadata.raw.ConstrainedParameter


      );
      List<ConstrainedParameter> parameterMetaDataList = newArrayList();

      for ( int i = 0; i < oneMethod.getParameterTypes().length; i++ ) {
        parameterMetaDataList.add(
            new ConstrainedParameter(
                ConfigurationSource.API,
                new MethodConstraintLocation( oneMethod, i ),
                DEFAULT_PARAMETER_NAME_PREFIX + i,
                asMetaConstraints( constraintsByParameter.get( i ) ),
                cascadesByParameter.containsKey( i )
View Full Code Here


          parameterIsCascading = true;
        }
      }

      metaData.add(
          new ConstrainedParameter(
              ConfigurationSource.ANNOTATION,
              new MethodConstraintLocation( method, i ),
              parameterName,
              constraintsOfOneParameter,
              parameterIsCascading
View Full Code Here

      );
      List<ConstrainedParameter> parameterMetaDataList = newArrayList();

      for ( int i = 0; i < oneMethod.getParameterTypes().length; i++ ) {
        parameterMetaDataList.add(
            new ConstrainedParameter(
                ConfigurationSource.API,
                new ExecutableConstraintLocation( oneMethod, i ),
                parameterNames[i],
                asMetaConstraints( constraintsByParameter.get( i ) ),
                Collections.<Class<?>, Class<?>>emptyMap(),
View Full Code Here

          groupConversionList = (ConvertGroup.List) parameterAnnotation;
        }
      }

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

    }

    @Override
    public void add(ConstrainedElement constrainedElement) {
      super.add( constrainedElement );
      ConstrainedParameter constrainedParameter = (ConstrainedParameter) constrainedElement;

      if ( name == null ) {
        name = constrainedParameter.getParameterName();
      }
    }
View Full Code Here

            i,
            parameterType.getIgnoreAnnotations()
        );
      }

      ConstrainedParameter constrainedParameter = new ConstrainedParameter(
          ConfigurationSource.XML,
          constraintLocation,
          parameterNames.get( i ),
          metaConstraints,
          groupConversions,
View Full Code Here

    }

    @Override
    public void add(ConstrainedElement constrainedElement) {
      super.add( constrainedElement );
      ConstrainedParameter constrainedParameter = (ConstrainedParameter) constrainedElement;

      if ( name == null ) {
        name = constrainedParameter.getName();
      }
    }
View Full Code Here

      ConvertGroup.List groupConversionList = null;
      boolean requiresUnwrapping = false;

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

      for ( Annotation parameterAnnotation : parameterAnnotations ) {
        //1. mark parameter as cascading if this annotation is the @Valid annotation
        if ( parameterAnnotation.annotationType().equals( Valid.class ) ) {
          parameterIsCascading = true;
        }
        //2. 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;
        }
        //3. unwrapping required?
        else if ( parameterAnnotation.annotationType().equals( UnwrapValidatedValue.class ) ) {
          requiresUnwrapping = true;
        }

        //4. 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 )
          );
        }
      }

      metaData.add(
          new ConstrainedParameter(
              ConfigurationSource.ANNOTATION,
              ConstraintLocation.forParameter( executable, i ),
              ReflectionHelper.typeOf( executable, i ),
              i,
              parameterName,
View Full Code Here

            i,
            parameterType.getIgnoreAnnotations()
        );
      }

      ConstrainedParameter constrainedParameter = new ConstrainedParameter(
          ConfigurationSource.XML,
          constraintLocation,
          ReflectionHelper.typeOf( executableElement, i ),
          i,
          parameterNames.get( i ),
View Full Code Here

      if ( parameter != null ) {
        constrainedParameters.add( parameter.build( constraintHelper, parameterNameProvider ) );
      }
      else {
        constrainedParameters.add(
            new ConstrainedParameter(
                ConfigurationSource.API,
                ConstraintLocation.forParameter( executable, i ),
                ReflectionHelper.typeOf( executable, i ),
                i,
                executable.getParameterNames( parameterNameProvider ).get( i )
View Full Code Here

TOP

Related Classes of org.hibernate.validator.internal.metadata.raw.ConstrainedParameter

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.