Package javax.validation

Examples of javax.validation.Path$Node


        "Wrong number of property paths. Expected: " + propertyPaths.length + " Actual: " + propertyPathsOfViolations
            .size()
    );

    for ( String propertyPath : propertyPaths ) {
      Path expectedPath = PathImpl.createPathFromString( propertyPath );
      boolean containsPath = false;
      for ( Path actualPath : propertyPathsOfViolations ) {
        if ( assertEqualPaths( expectedPath, actualPath ) ) {
          containsPath = true;
          break;
View Full Code Here


      }
    }
  }

  public static <T> void assertConstraintViolation(ConstraintViolation<T> violation, Class<?> rootBean, Object invalidValue, String propertyPath) {
    Path expectedPath = PathImpl.createPathFromString( propertyPath );
    if ( !assertEqualPaths( violation.getPropertyPath(), expectedPath ) ) {
      fail( "Property paths differ. Actual: " + violation.getPropertyPath() + " Expected: " + expectedPath );
    }

    assertEquals(
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

      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

    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

  private boolean isCascadeRequired(ValidationContext<?, ?> validationContext, ValueContext<?, ?> valueContext, ElementType type) {
    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

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

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

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

TOP

Related Classes of javax.validation.Path$Node

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.