Package javax.validation

Examples of javax.validation.Path$CrossParameterNode


        .validateConstructorParameters( constructor, arguments );

    //then
    assertCorrectNumberOfViolations( constraintViolations, 1 );

    Path propertyPath = constraintViolations.iterator().next().getPropertyPath();

    assertDescriptorKinds( propertyPath, ElementKind.CONSTRUCTOR, ElementKind.PARAMETER, ElementKind.PROPERTY );
    assertNodeNames( propertyPath, "User", "arg0", "street1" );
  }
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

            localContext.getCurrentValidatedValue(),
            getRootBeanClass()
        )
    );

    Path path = messageAndPath.getPath();

    return new ConstraintViolationImpl<T>(
        messageTemplate,
        interpolatedMessage,
        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

  private <T> ConstraintViolation<T> createViolation(
      String msg, T rootBean, final String path) {
    return new ConstraintViolationImpl.Builder<T>()
        .setMessage(msg)
        .setRootBean(rootBean)
        .setPropertyPath(new Path() {
          @Override
          public Iterator<Node> iterator() {
            return null;
          }
View Full Code Here

    public String getMessageTemplate() {
      return messageTemplate;
    }

    public Path getPropertyPath() {
      return new Path() {
        public Iterator<Node> iterator() {
          return Collections.<Node> emptyList().iterator();
        }

        @Override
View Full Code Here

    assertEquals(propertyPaths.length, propertyPathsOfViolations.size(),
        "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);
    }
View Full Code Here

      return false;
    }

    boolean isReachable;

    Path pathToObject = valueContext.getPropertyPath().getPathWithoutLeafNode();
    if ( pathToObject == null ) {
      pathToObject = PathImpl.createNewPath( null );
    }

    try {
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.