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

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


  public void unwrapValidatedValueOnMethod() throws Exception {
    List<BeanConfiguration<? super GolfPlayer>> beanConfigurations = provider.getBeanConfigurationForHierarchy(
        GolfPlayer.class
    );

    ConstrainedExecutable constrainedMethod = findConstrainedMethod(
        beanConfigurations,
        GolfPlayer.class,
        "enterTournament"
    );

    assertEquals( constrainedMethod.unwrapMode(), UnwrapMode.UNWRAP );
  }
View Full Code Here


    @SuppressWarnings("rawtypes")
    List<BeanConfiguration<? super Wrapper>> beanConfigurations = provider.getBeanConfigurationForHierarchy(
        Wrapper.class
    );

    ConstrainedExecutable constrainedConstructor = findConstrainedConstructor(
        beanConfigurations,
        Wrapper.class,
        Object.class
    );

    assertEquals( constrainedConstructor.unwrapMode(), UnwrapMode.UNWRAP );
  }
View Full Code Here

  public void unwrapValidatedValueOnParameter() throws Exception {
    List<BeanConfiguration<? super GolfPlayer>> beanConfigurations = provider.getBeanConfigurationForHierarchy(
        GolfPlayer.class
    );

    ConstrainedExecutable constrainedMethod = findConstrainedMethod(
        beanConfigurations,
        GolfPlayer.class,
        "practice",
        Wrapper.class
    );

    assertEquals( constrainedMethod.getParameterMetaData( 0 ).unwrapMode(), UnwrapMode.UNWRAP );
  }
View Full Code Here

    }

    @Override
    public void add(ConstrainedElement constrainedElement) {
      super.add( constrainedElement );
      ConstrainedExecutable constrainedExecutable = (ConstrainedExecutable) constrainedElement;

      constrainedExecutables.add( constrainedExecutable );
      isConstrained = isConstrained || constrainedExecutable.isConstrained();
      crossParameterConstraints.addAll( constrainedExecutable.getCrossParameterConstraints() );
      typeArgumentsConstraints.addAll( constrainedExecutable.getTypeArgumentsConstraints() );

      addToExecutablesByDeclaringType( constrainedExecutable );
    }
View Full Code Here

     *
     * @param executable The executable to merge.
     */
    private void addToExecutablesByDeclaringType(ConstrainedExecutable executable) {
      Class<?> beanClass = executable.getLocation().getDeclaringClass();
      ConstrainedExecutable mergedExecutable = executablesByDeclaringType.get( beanClass );

      if ( mergedExecutable != null ) {
        mergedExecutable = mergedExecutable.merge( executable );
      }
      else {
        mergedExecutable = executable;
      }

      executablesByDeclaringType.put( beanClass, mergedExecutable.merge( executable ) );
    }
View Full Code Here

            method,
            methodType.getIgnoreAnnotations()
        );
      }

      ConstrainedExecutable constrainedExecutable = parseExecutableType(
          defaultPackage,
          methodType.getParameter(),
          methodType.getCrossParameter(),
          methodType.getReturnValue(),
          methodExecutableElement,
View Full Code Here

            constructor,
            constructorType.getIgnoreAnnotations()
        );
      }

      ConstrainedExecutable constrainedExecutable = parseExecutableType(
          defaultPackage,
          constructorType.getParameter(),
          constructorType.getCrossParameter(),
          constructorType.getReturnValue(),
          constructorExecutableElement,
View Full Code Here

        defaultPackage,
        constraintHelper,
        annotationProcessingOptions
    );

    return new ConstrainedExecutable(
        ConfigurationSource.XML,
        ConstraintLocation.forReturnValue( executableElement ),
        parameterMetaData,
        crossParameterConstraints,
        returnValueConstraints,
View Full Code Here

      Map<Class<?>, Class<?>> groupConversions = GroupConversionBuilder.buildGroupConversionMap(
          getterType.getConvertGroup(),
          defaultPackage
      );

      ConstrainedExecutable constrainedGetter = new ConstrainedExecutable(
          ConfigurationSource.XML,
          constraintLocation,
          Collections.<ConstrainedParameter>emptyList(),
          Collections.<MetaConstraint<?>>emptySet(),
          metaConstraints,
View Full Code Here

              constraintHelper
          );
          break;
        case CONSTRUCTOR:
        case METHOD:
          ConstrainedExecutable constrainedExecutable = (ConstrainedExecutable) constrainedElement;
          methodBuilder = new ExecutableMetaData.Builder(
              beanClass,
              constrainedExecutable,
              constraintHelper,
              executableHelper
          );

          if ( constrainedExecutable.isGetterMethod() ) {
            propertyBuilder = new PropertyMetaData.Builder(
                beanClass,
                constrainedExecutable,
                constraintHelper
            );
View Full Code Here

TOP

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

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.