Package org.hibernate.validator.internal.engine.path

Examples of org.hibernate.validator.internal.engine.path.PathImpl


    }
  }

  private <T, U, V> void validateConstraintsForNonDefaultGroup(ValidationContext<T, ?> validationContext, ValueContext<U, V> valueContext) {
    BeanMetaData<U> beanMetaData = beanMetaDataManager.getBeanMetaData( valueContext.getCurrentBeanType() );
    PathImpl currentPath = valueContext.getPropertyPath();
    for ( MetaConstraint<?> metaConstraint : beanMetaData.getMetaConstraints() ) {
      validateConstraint( validationContext, valueContext, metaConstraint );
      if ( shouldFailFast( validationContext ) ) {
        return;
      }
View Full Code Here


   * @param valueContext Collected information for single validation
   */
  private <T, U, V> void validateCascadedConstraints(ValidationContext<T, ?> validationContext, ValueContext<U, V> valueContext) {
    BeanMetaData<U> beanMetaData = beanMetaDataManager.getBeanMetaData( valueContext.getCurrentBeanType() );
    Set<Member> cascadedMembers = beanMetaData.getCascadedMembers();
    PathImpl currentPath = valueContext.getPropertyPath();
    for ( Member member : cascadedMembers ) {
      String newNode = ReflectionHelper.getPropertyName( member );
      valueContext.appendNode( newNode );

      if ( isCascadeRequired( validationContext, valueContext, member ) ) {
View Full Code Here

    if ( ElementType.TYPE.equals( metaConstraint.getElementType() ) ) {
      return true;
    }

    boolean isReachable;
    PathImpl path = valueContext.getPropertyPath();
    Path pathToObject = path.getPathWithoutLeafNode();

    try {
      isReachable = validationContext.getTraversableResolver().isReachable(
          valueContext.getCurrentBean(),
          path.getLeafNode(),
          validationContext.getRootBeanClass(),
          pathToObject,
          metaConstraint.getElementType()
      );
    }
View Full Code Here

  private boolean isCascadeRequired(ValidationContext<?, ?> validationContext, ValueContext<?, ?> valueContext, Member member) {
    final ElementType type = member instanceof Field ? ElementType.FIELD : ElementType.METHOD;
    boolean isReachable;
    boolean isCascadable;

    PathImpl path = valueContext.getPropertyPath();
    Path pathToObject = path.getPathWithoutLeafNode();

    // HV-524 - class level constraints are reachable
    if ( ElementType.TYPE.equals( type ) ) {
      isReachable = true;
    }
    else {
      try {
        isReachable = validationContext.getTraversableResolver().isReachable(
            valueContext.getCurrentBean(),
            path.getLeafNode(),
            validationContext.getRootBeanClass(),
            pathToObject,
            type
        );
      }
      catch ( RuntimeException e ) {
        throw log.getErrorDuringCallOfTraversableResolverIsReachableException( e );
      }
    }

    if ( ElementType.TYPE.equals( type ) ) {
      isCascadable = true;
    }
    else {
      try {
        isCascadable = validationContext.getTraversableResolver().isCascadable(
            valueContext.getCurrentBean(),
            path.getLeafNode(),
            validationContext.getRootBeanClass(),
            pathToObject,
            type
        );
      }
View Full Code Here

      // if the current class redefined the default group sequence, this sequence has to be applied to all the class hierarchy.
      if ( defaultGroupSequenceIsRedefined ) {
        metaConstraints = hostingBeanMetaData.getMetaConstraints();
      }

      PathImpl currentPath = valueContext.getPropertyPath();
      for ( Class<?> defaultSequenceMember : defaultGroupSequence ) {
        valueContext.setCurrentGroup( defaultSequenceMember );
        boolean validationSuccessful = true;
        for ( MetaConstraint<?> metaConstraint : metaConstraints ) {
          // HV-466, an interface implemented more than one time in the hierarchy has to be validated only one
View Full Code Here

    }
  }

  private void validateConstraintsForNonDefaultGroup(ValidationContext<?> validationContext, ValueContext<?, Object> valueContext) {
    BeanMetaData<?> beanMetaData = beanMetaDataManager.getBeanMetaData( valueContext.getCurrentBeanType() );
    PathImpl currentPath = valueContext.getPropertyPath();
    for ( MetaConstraint<?> metaConstraint : beanMetaData.getMetaConstraints() ) {
      validateConstraint( validationContext, valueContext, metaConstraint );
      if ( shouldFailFast( validationContext ) ) {
        return;
      }
View Full Code Here

   * @param validationContext The execution context
   * @param valueContext Collected information for single validation
   */
  private void validateCascadedConstraints(ValidationContext<?> validationContext, ValueContext<?, ?> valueContext) {
    Validatable validatable = valueContext.getCurrentValidatable();
    PathImpl originalPath = valueContext.getPropertyPath();
    Class<?> originalGroup = valueContext.getCurrentGroup();

    for ( Cascadable cascadable : validatable.getCascadables() ) {
      valueContext.appendNode( cascadable );
      Class<?> group = cascadable.convertGroup( originalGroup );
View Full Code Here

      );
      valueContext.setCurrentValidatedValue( parameterValues );

      // 2. validate parameter constraints
      for ( int i = 0; i < parameterValues.length; i++ ) {
        PathImpl originalPath = valueContext.getPropertyPath();

        ParameterMetaData parameterMetaData = executableMetaData.getParameterMetaData( i );
        Object value = parameterValues[i];

        if ( value != null ) {
View Full Code Here

      // if the current class redefined the default group sequence, this sequence has to be applied to all the class hierarchy.
      if ( defaultGroupSequenceIsRedefined ) {
        metaConstraints = hostingBeanMetaData.getMetaConstraints();
      }

      PathImpl currentPath = valueContext.getPropertyPath();
      for ( Class<?> defaultSequenceMember : defaultGroupSequence ) {
        valueContext.setCurrentGroup( defaultSequenceMember );
        boolean validationSuccessful = true;
        for ( MetaConstraint<?> metaConstraint : metaConstraints ) {
          // HV-466, an interface implemented more than one time in the hierarchy has to be validated only one
View Full Code Here

    }
  }

  private void validateConstraintsForNonDefaultGroup(ValidationContext<?> validationContext, ValueContext<?, Object> valueContext) {
    BeanMetaData<?> beanMetaData = beanMetaDataManager.getBeanMetaData( valueContext.getCurrentBeanType() );
    PathImpl currentPath = valueContext.getPropertyPath();
    for ( MetaConstraint<?> metaConstraint : beanMetaData.getMetaConstraints() ) {
      validateConstraint( validationContext, valueContext, metaConstraint );
      if ( shouldFailFast( validationContext ) ) {
        return;
      }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.internal.engine.path.PathImpl

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.