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

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


    List<ConstrainedParameter> parameterConstraints = getParameterMetaData( method );
    boolean isCascading = method.isAnnotationPresent( Valid.class );
    Set<MetaConstraint<?>> constraints =
        convertToMetaConstraints( findConstraints( method, ElementType.METHOD ), method );

    return new ConstrainedMethod(
        ConfigurationSource.ANNOTATION,
        new MethodConstraintLocation( method ),
        parameterConstraints,
        constraints,
        isCascading
View Full Code Here


    List<ConstrainedParameter> parameterConstraints = getParameterMetaData( method );
    boolean isCascading = method.isAnnotationPresent( Valid.class );
    Set<MetaConstraint<?>> constraints =
        convertToMetaConstraints( findConstraints( method, ElementType.METHOD ), method );

    return new ConstrainedMethod(
        ConfigurationSource.ANNOTATION,
        new MethodConstraintLocation( method ),
        parameterConstraints,
        constraints,
        isCascading
View Full Code Here

    List<ConstrainedParameter> parameterConstraints = getParameterMetaData( method );
    boolean isCascading = method.isAnnotationPresent( Valid.class );
    Set<MetaConstraint<?>> constraints =
        convertToMetaConstraints( findConstraints( method, ElementType.METHOD ), method );

    return new ConstrainedMethod(
        ConfigurationSource.ANNOTATION,
        new MethodConstraintLocation( method ),
        parameterConstraints,
        constraints,
        isCascading
View Full Code Here

            )
        );
      }
      else if ( oneConfiguredLocation.getElementType() == ElementType.METHOD ) {
        propertyMetaData.add(
            new ConstrainedMethod(
                ConfigurationSource.XML,
                new MethodConstraintLocation( (Method) oneConfiguredLocation.getMember() ),
                constraintsByLocation.get( oneConfiguredLocation ),
                cascades.contains( oneConfiguredLocation )
            )
View Full Code Here

                cascadesByParameter.containsKey( i )
            )
        );
      }

      ConstrainedMethod methodMetaData = new ConstrainedMethod(
          ConfigurationSource.API,
          new MethodConstraintLocation( oneMethod ),
          parameterMetaDataList,
          asMetaConstraints( constraintsByParameter.get( null ) ),
          cascadesByParameter.containsKey( null )
View Full Code Here

          );
          break;

        case METHOD:

          ConstrainedMethod constrainedMethod = (ConstrainedMethod) constrainedElement;
          methodBuilder = new MethodMetaData.Builder(
              constrainedMethod,
              constraintHelper
          );

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

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

        if ( added == false && constrainedElement.getKind() == ConstrainedElementKind.METHOD && methodBuilder == null ) {
          ConstrainedMethod constrainedMethod = (ConstrainedMethod) constrainedElement;
          methodBuilder = new MethodMetaData.Builder(
              constrainedMethod,
              constraintHelper
          );
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void add(ConstrainedElement constrainedElement) {

      ConstrainedMethod constrainedMethod = (ConstrainedMethod) constrainedElement;

      constrainedMethods.add( constrainedMethod );
      isCascading = isCascading || constrainedMethod.isCascading();
      isConstrained = isConstrained || constrainedMethod.isConstrained();
      returnValueConstraints.addAll( constrainedMethod.getConstraints() );
    }
View Full Code Here

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

      ConstrainedMethod constrainedMethod = methodsWithParameterConstraints.iterator().next();

      for ( ConstrainedMethod oneMethod : constrainedMethods ) {

        if ( !constrainedMethod.getLocation().getBeanClass()
            .isAssignableFrom( oneMethod.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 " +
                  constrainedMethod.getLocation().getBeanClass() + ": " + oneMethod
          );
        }
      }

      return null;
View Full Code Here

                cascadesByParameter.containsKey( i )
            )
        );
      }

      ConstrainedMethod methodMetaData = new ConstrainedMethod(
          ConfigurationSource.API,
          new MethodConstraintLocation( oneMethod ),
          parameterMetaDataList,
          asMetaConstraints( constraintsByParameter.get( null ) ),
          cascadesByParameter.containsKey( null )
View Full Code Here

TOP

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

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.