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

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


                "but there are parameter constraints defined at all of the following overridden methods: " +
                executablesWithParameterConstraints
        );
      }

      ConstrainedExecutable constrainedExecutable = executablesWithParameterConstraints.iterator().next();

      for ( ConstrainedExecutable oneExecutable : constrainedExecutables ) {

        if ( !constrainedExecutable.getLocation().getBeanClass()
            .isAssignableFrom( oneExecutable.getLocation().getBeanClass() ) ) {
          return new ConstraintDeclarationException(
              "Only the root method of an overridden method in an inheritance hierarchy may be annotated with parameter constraints. " +
                  "The following method itself has no parameter constraints but it is not defined on a sub-type of " +
                  constrainedExecutable.getLocation().getBeanClass() + ": " + oneExecutable
          );
        }
      }

      return null;
View Full Code Here


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

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

      if ( propertyBuilder != null && propertyBuilder.accepts( constrainedElement ) ) {
        propertyBuilder.add( constrainedElement );

        if ( added == false && constrainedElement.getKind() == ConstrainedElementKind.METHOD && methodBuilder == null ) {
          ConstrainedExecutable constrainedMethod = (ConstrainedExecutable) constrainedElement;
          methodBuilder = new ExecutableMetaData.Builder(
              constrainedMethod,
              constraintHelper
          );
        }
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() );
    }
View Full Code Here

                "but there are parameter constraints defined at all of the following overridden methods: " +
                executablesWithParameterConstraints
        );
      }

      ConstrainedExecutable constrainedExecutable = executablesWithParameterConstraints.iterator()
          .next();

      for ( ConstrainedExecutable oneExecutable : constrainedExecutables ) {

        if ( !constrainedExecutable.getLocation().getBeanClass()
            .isAssignableFrom( oneExecutable.getLocation().getBeanClass() ) ) {
          return new ConstraintDeclarationException(
              "Only the root method of an overridden method in an inheritance hierarchy may be annotated with parameter constraints. " +
                  "The following method itself has no parameter constraints but it is not defined on a sub-type of " +
                  constrainedExecutable.getLocation()
                      .getBeanClass() + ": " + oneExecutable
          );
        }
      }
View Full Code Here

      return null;
    }

    private ConstraintDeclarationException checkReturnValueConfiguration() {
      ConstrainedExecutable methodWithCascadingReturnValue = null;

      for ( ConstrainedExecutable executable : constrainedExecutables ) {
        if ( executable.getLocation().getExecutableElement().getReturnType() == void.class &&
            ( !executable.getConstraints().isEmpty() || executable.isCascading() ) ) {
          return log.voidMethodsMustNotBeConstrained( executable.getLocation().getMember() );
        }

        if ( executable.isCascading() ) {
          if ( methodWithCascadingReturnValue != null ) {
            return log.methodReturnValueMustNotBeMarkedMoreThanOnceForCascadedValidation(
                methodWithCascadingReturnValue.getLocation().getMember(),
                executable.getLocation().getMember()
            );
          }
          methodWithCascadingReturnValue = executable;
        }
View Full Code Here

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

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

      if ( propertyBuilder != null && propertyBuilder.accepts( constrainedElement ) ) {
        propertyBuilder.add( constrainedElement );

        if ( !added && constrainedElement.getKind() == ConstrainedElementKind.METHOD && methodBuilder == null ) {
          ConstrainedExecutable constrainedMethod = (ConstrainedExecutable) constrainedElement;
          methodBuilder = new ExecutableMetaData.Builder(
              beanClass,
              constrainedMethod,
              constraintHelper
          );
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

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.