Package javax.validation

Examples of javax.validation.Path$CrossParameterNode


            descriptor,
            localContext.getCurrentValidatedValue(),
            getRootBeanClass()
        )
    );
    Path path = messageAndPath.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

      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

        this.rootBeanClass = rootBeanClass;
        contextPath = new PathImpl();
    }

    public void register(Object bean, String property, String message, String messageTemplate, Object invalidValue) {
        Path path = property != null ? contextPath.push(new PathImpl.NodeImpl(property)) : contextPath;
        ConstraintViolation<T> violation = new ConstraintViolationImpl<T>(
                message, messageTemplate, rootBean, rootBeanClass, bean, path, invalidValue);
        violations.add(violation);
    }
View Full Code Here

        super(name);
    }

    public void testParsing() {
        String property = "order[3].deliveryAddress.addressline[1]";
        Path path = PathImpl.createPathFromString(property);
        assertEquals(property, path.toString());
       
        Iterator<Path.Node> propIter = path.iterator();

        assertTrue(propIter.hasNext());
        Path.Node elem = propIter.next();
        assertEquals("order", elem.getName());
        assertTrue(elem.isInIterable());
View Full Code Here

        assertFalse(propIter.hasNext());
    }

    public void testParseMapBasedProperty() {
        String property = "order[foo].deliveryAddress";
        Path path = PathImpl.createPathFromString(property);
        Iterator<Path.Node> propIter = path.iterator();

        assertTrue(propIter.hasNext());
        Path.Node elem = propIter.next();
        assertEquals("order", elem.getName());
        assertTrue(elem.isInIterable());
View Full Code Here

    public void testNull() {
        assertEquals(PathImpl.createPathFromString(null), PathImpl.create(null));

        assertEquals("", PathImpl.create(null).toString());
        Path path = PathImpl.create(null);
        Path.Node node = path.iterator().next();
        assertEquals(null, node.getName());
    }
View Full Code Here

        } catch (IllegalArgumentException ex) {
        }
    }

    public void testEmptyString() {
        Path path = PathImpl.createPathFromString("");
        assertEquals(null, path.iterator().next().getName());
    }
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.