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

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


    }

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

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


          .getIgnoreAnnotations();
      if ( ignoreConstructorAnnotations ) {
        annotationProcessingOptions.ignoreConstraintAnnotationsOnParameter( executableElement.getMember(), i );
      }

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

      ConvertGroup groupConversion = null;
      ConvertGroup.List groupConversionList = null;

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

          parameterIsCascading = true;
        }
      }

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

          parameterIsCascading = true;
        }
      }

      metaData.add(
          new ConstrainedParameter(
              ConfigurationSource.ANNOTATION,
              new MethodConstraintLocation( method, i ),
              parameterName,
              constraintsOfOneParameter,
              parameterIsCascading
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

          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 MethodConstraintLocation( oneMethod, i ),
                DEFAULT_PARAMETER_NAME_PREFIX + i,
                asMetaConstraints( constraintsByParameter.get( i ) ),
                cascadesByParameter.containsKey( i )
View Full Code Here

    }

    @Override
    public void add(ConstrainedElement constrainedElement) {

      ConstrainedParameter constrainedParameter = (ConstrainedParameter) constrainedElement;

      constraints.addAll( constrainedParameter.getConstraints() );

      if ( name == null ) {
        name = constrainedParameter.getParameterName();
      }

      isCascading = isCascading || constrainedParameter.isCascading();
    }
View Full Code Here

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

      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(),
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.