Examples of PathImpl


Examples of org.apache.bval.jsr303.util.PathImpl

     * to-many-relationships.
     *
     * @return the path in dot notation
     */
    public PathImpl getPropertyPath() {
        PathImpl currentPath = PathImpl.copy(path);
        if (getMetaProperty() != null) {
            currentPath.addProperty(getMetaProperty().getName());
        }
        return currentPath;
    }
View Full Code Here

Examples of org.apache.bval.jsr303.util.PathImpl

            }
        }
    }

    private boolean isReachable(GroupValidationContext<?> context) {
        PathImpl path = context.getPropertyPath();
        NodeImpl node = path.getLeafNode();
        PathImpl beanPath = path.getPathWithoutLeafNode();
        if (beanPath == null) {
            beanPath = PathImpl.create(null);
        }
        try {
            if (!context.getTraversableResolver().isReachable(context.getBean(), node,
View Full Code Here

Examples of org.apache.bval.jsr303.util.PathImpl

        /**
         * {@inheritDoc}
         */
        public NodeBuilderDefinedContext addNode(String name) {
            PathImpl path;
            if (propertyPath.isRootPath()) {
                path = PathImpl.create(name);
            } else {
                path = PathImpl.copy(propertyPath);
                path.addNode(new NodeImpl(name));
            }
            return new NodeBuilderDefinedContextImpl(parent, messageTemplate, path);
        }
View Full Code Here

Examples of org.apache.bval.jsr303.util.PathImpl

     * @param access  The access strategy used to get the related bean value.
     * @return <code>true</code> if the validator can access the related bean, <code>false</code> otherwise.
     */
    private boolean isCascadable(GroupValidationContext<?> context, MetaProperty prop, AccessStrategy access) {

        PathImpl beanPath = context.getPropertyPath();
        NodeImpl node = new NodeImpl(prop.getName());
        if (beanPath == null) {
            beanPath = PathImpl.create(null);
        }
        try {
View Full Code Here

Examples of org.apache.bval.jsr303.util.PathImpl

    public void testPerson1() {
        cvb.addNode("person").addNode(null).inIterable().atIndex(1)
                .addConstraintViolation();
        Error error = cvc.getErrorMessages().iterator().next();
        PathImpl errorPath = (PathImpl) error.getOwner();
        Assert.assertEquals("Incorrect path created", "person[1]", errorPath
                .toString());
    }
View Full Code Here

Examples of org.apache.bval.jsr303.util.PathImpl

    public void testPersonLawyerName() {
        cvb.addNode("person").addNode("name").inIterable().atKey("john")
                .addConstraintViolation();
        Error error = cvc.getErrorMessages().iterator().next();
        PathImpl errorPath = (PathImpl) error.getOwner();
        Assert.assertEquals("Incorrect path created", "person[john].name",
                errorPath.toString());
    }
View Full Code Here

Examples of org.apache.bval.jsr303.util.PathImpl

    public void test0Name() {
        cvb.addNode(null).addNode("name").inIterable().atIndex(0).addNode(null)
                .inIterable().addConstraintViolation();
        Error error = cvc.getErrorMessages().iterator().next();
        PathImpl errorPath = (PathImpl) error.getOwner();
        Assert.assertEquals("Incorrect path created", "[0].name[]", errorPath
                .toString());
    }
View Full Code Here

Examples of org.apache.bval.jsr303.util.PathImpl

    }

    public void testEmptyIndex() {
        cvb.addNode(null).addNode(null).inIterable().addConstraintViolation();
        Error error = cvc.getErrorMessages().iterator().next();
        PathImpl errorPath = (PathImpl) error.getOwner();
        Assert.assertEquals("Incorrect path created", "[]", errorPath
                .toString());
    }
View Full Code Here

Examples of org.apache.bval.jsr303.util.PathImpl

    public void testRootPath() {
        // Adding only nulls should still give a root path
        cvb.addNode(null).addNode(null).addNode(null).addNode(null)
                .addConstraintViolation();
        Error error = cvc.getErrorMessages().iterator().next();
        PathImpl errorPath = (PathImpl) error.getOwner();
        Assert.assertTrue("Created path must be a root path", errorPath
                .isRootPath());

    }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.ui.path.PathImpl

  static public Object walkTree(
    UIXRenderingContext context,
    UINode           ancestor,
    TreeWalker       walker) throws IOException
  {
    return walkTree(context, ancestor, walker, new PathImpl());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.