Package org.apache.bval.jsr.util

Examples of org.apache.bval.jsr.util.NodeImpl


        path.getLeafNode().setInIterable(true);
        return new NodeContextBuilderImpl(context, template, path);
    }

    public ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext addNode(String name) {
        path.addNode(new NodeImpl(name));
        return this;
    }
View Full Code Here


        path.addNode(new NodeImpl(name));
        return this;
    }

    public ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext addPropertyNode(String name) {
        final NodeImpl node = new NodeImpl.PropertyNodeImpl(name);
        node.setKind(ElementKind.PROPERTY);
        path.addNode(node);
        return this;
    }
View Full Code Here

        path.addNode(node);
        return this;
    }

    public ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeBuilderCustomizableContext addBeanNode() {
        final NodeImpl node = new NodeImpl.BeanNodeImpl();
        node.setKind(ElementKind.BEAN);
        path.addNode(node);
        return new LeafNodeBuilderCustomizableContextImpl(context, template, path);
    }
View Full Code Here

            if (propertyPath.isRootPath()) {
                path = PathImpl.create();
                path.getLeafNode().setName(name);
            } else {
                path = PathImpl.copy(propertyPath);
                path.addNode(new NodeImpl(name));
            }
            return new NodeBuilderDefinedContextImpl(parent, messageTemplate, path);
        }
View Full Code Here

            }
            return new NodeBuilderDefinedContextImpl(parent, messageTemplate, path);
        }

        public NodeBuilderCustomizableContext addPropertyNode(String name) {
            final NodeImpl node;
            if (!propertyPath.isRootPath()) {
                if (propertyPath.getLeafNode().getKind() != null) {
                    node = new NodeImpl.PropertyNodeImpl(name);
                    propertyPath.addNode(node);
                } else {
                    node = propertyPath.getLeafNode();
                }
            } else {
                node = new NodeImpl.PropertyNodeImpl(name);
                propertyPath.addNode(node);
            }
            node.setName(name);
            node.setKind(ElementKind.PROPERTY); // enforce it
            return new NodeBuilderCustomizableContextImpl(parent, messageTemplate, propertyPath);
        }
View Full Code Here

            node.setKind(ElementKind.PROPERTY); // enforce it
            return new NodeBuilderCustomizableContextImpl(parent, messageTemplate, propertyPath);
        }

        public LeafNodeBuilderCustomizableContext addBeanNode() {
            final NodeImpl node = new NodeImpl.BeanNodeImpl();
            node.setKind(ElementKind.BEAN);
            propertyPath.addNode(node);
            return new LeafNodeBuilderCustomizableContextImpl(parent, messageTemplate, propertyPath);
        }
View Full Code Here

        }

        public NodeBuilderDefinedContext addParameterNode(int index) {
            final Method method = parent.validationContext.getMethod();
            final List<String> parameters = parent.validationContext.getParameterNameProvider().getParameterNames(method);
            final NodeImpl node = new NodeImpl.ParameterNodeImpl(parameters.get(index), index);
            node.setParameterIndex(index);
            node.setKind(ElementKind.PARAMETER);
            if (!propertyPath.isRootPath()) {
                propertyPath.removeLeafNode();
            }
            propertyPath.addNode(node);
            return new NodeBuilderDefinedContextImpl(parent, messageTemplate, propertyPath);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public void setCurrentIndex(Integer index) {
        NodeImpl leaf = path.getLeafNode();
        if (leaf.getName() == null) {
            leaf.setIndex(index);
        } else {
            path.addNode(NodeImpl.atIndex(index));
        }
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public void setCurrentKey(Object key) {
        NodeImpl leaf = path.getLeafNode();
        if (leaf.getName() == null) {
            leaf.setKey(key);
        } else {
            path.addNode(NodeImpl.atKey(key));
        }
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public void moveUp(Object bean, MetaBean metaBean) {
        NodeImpl leaf = path.getLeafNode();
        if (leaf.isInIterable() && leaf.getName() != null) {
            leaf.setName(null);
        } else {
            path.removeLeafNode();
        }
        super.moveUp(bean, metaBean); // call super!
    }
View Full Code Here

TOP

Related Classes of org.apache.bval.jsr.util.NodeImpl

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.