Package javax.validation

Examples of javax.validation.Path$CrossParameterNode


        messageTemplate,
        localContext.getCurrentValidatedValue(),
        descriptor,
        constraintViolationCreationContext.getExpressionVariables()
    );
    Path path = constraintViolationCreationContext.getPath();

    if ( executableParameters != null ) {
      return ConstraintViolationImpl.forParameterValidation(
          messageTemplate,
          interpolatedMessage,
View Full Code Here


  private boolean isReachable(ValidationContext<?> validationContext, Object traversableObject, PathImpl path, ElementType type) {
    if ( needToCallTraversableResolver( path, type ) ) {
      return true;
    }

    Path pathToObject = path.getPathWithoutLeafNode();
    try {
      return validationContext.getTraversableResolver().isReachable(
          traversableObject,
          path.getLeafNode(),
          validationContext.getRootBeanClass(),
View Full Code Here

    boolean isReachable = isReachable( validationContext, traversableObject, path, type );
    if ( !isReachable ) {
      return false;
    }

    Path pathToObject = path.getPathWithoutLeafNode();
    try {
      return validationContext.getTraversableResolver().isCascadable(
          traversableObject,
          path.getLeafNode(),
          validationContext.getRootBeanClass(),
View Full Code Here

  private boolean isReachable(ValidationContext<?> validationContext, Object traversableObject, PathImpl path, ElementType type) {
    if ( needToCallTraversableResolver( path, type ) ) {
      return true;
    }

    Path pathToObject = path.getPathWithoutLeafNode();
    try {
      return validationContext.getTraversableResolver().isReachable(
          traversableObject,
          path.getLeafNode(),
          validationContext.getRootBeanClass(),
View Full Code Here

    boolean isReachable = isReachable( validationContext, traversableObject, path, type );
    if ( !isReachable ) {
      return false;
    }

    Path pathToObject = path.getPathWithoutLeafNode();
    try {
      return validationContext.getTraversableResolver().isCascadable(
          traversableObject,
          path.getLeafNode(),
          validationContext.getRootBeanClass(),
View Full Code Here

    String interpolatedMessage = messageInterpolator.interpolate(
        messageTemplate,
        new MessageInterpolatorContext( descriptor, localContext.getCurrentValidatedValue() )
    );

    Path path = createPathWithElementDescriptors( messageAndPath.getPath(), localContext );

    return new ConstraintViolationImpl<T>(
        messageTemplate,
        interpolatedMessage,
        getRootBeanClass(),
View Full Code Here

      return true;
    }

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

    try {
      isReachable = validationContext.getTraversableResolver().isReachable(
          valueContext.getCurrentBean(),
          path.getLeafNode(),
View Full Code Here

    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;
    }
View Full Code Here

    }

    private void buildValidationErrorMessage(StringBuilder errorMessage,
        ConstraintViolation<EntityWithGroupConstraint> violation) {
      String className = violation.getLeafBean().getClass().getCanonicalName();
      Path propertyPath = violation.getPropertyPath();

      errorMessage.append("\t");
      errorMessage.append("property '").append(propertyPath).append("'") //
          .append(" of class '").append(className).append("' ") //
          .append(violation.getMessage()).append("\n");
View Full Code Here

  @Test
  public void should_raise_exception_when_bean_validation_error_for_property() throws Exception {
    // Given
    boolean exceptionRaised = false;
    CompleteBean entity = new CompleteBean();
    Path propertyPath = mock(Path.class);
    when(validator.validate(entity)).thenReturn(Sets.<ConstraintViolation<CompleteBean>> newHashSet(violation));
    when(violation.getLeafBean().getClass().getCanonicalName()).thenReturn("className");
    when(violation.getPropertyPath()).thenReturn(propertyPath);
    when(propertyPath.toString()).thenReturn("property");
    when(violation.getMessage()).thenReturn("violation");

    try {
      // When
      interceptor.onEvent(entity);
View Full Code Here

TOP

Related Classes of javax.validation.Path$CrossParameterNode

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.