Package org.apache.commons.jxpath

Examples of org.apache.commons.jxpath.JXPathException


        JXPathContext context,
        QName name,
        int index,
        Object value)
    {
        throw new JXPathException(
            "Cannot create an object for path "
                + asPath()
                + "/"
                + name
                + "["
View Full Code Here


    public NodePointer createChild(
        JXPathContext context,
        QName name,
        int index)
    {
        throw new JXPathException(
            "Cannot create an object for path "
                + asPath()
                + "/"
                + name
                + "["
View Full Code Here

   
    /**
     * Called to create a non-existing attribute
     */
    public NodePointer createAttribute(JXPathContext context, QName name) {
        throw new JXPathException(
            "Cannot create an attribute for path "
                + asPath() + "/@" + name
                + ", operation is not allowed for this type of node");
    }
View Full Code Here

        if (p1 != null && p1.equals(p2)) {
            return 0;
        }

        if (depth1 == 1) {
            throw new JXPathException(
                "Cannot compare pointers that do not belong to the same tree: '"
                    + p1
                    + "' and '"
                    + p2
                    + "'");
View Full Code Here

        return name;
    }

    public Object getBaseValue() {
        if (!actual) {
            throw new JXPathException("Undefined variable: " + name);
        }
        return variables.getVariable(name.toString());
    }
View Full Code Here

        return value;
    }

    public void setValue(Object value) {
        if (!actual) {
            throw new JXPathException("Cannot set undefined variable: " + name);
        }
        valuePointer = null;
        if (index != WHOLE_COLLECTION) {
            Object collection = getBaseValue();
            ValueUtils.setValue(collection, index, value);
View Full Code Here

                    NodePointer.newChildNodePointer(this, null, value);
            }
            else {
                return new NullPointer(this, getName()) {
                    public Object getImmediateNode() {
                        throw new JXPathException(
                            "Undefined variable: " + name);
                    }
                };
            }
        }
View Full Code Here

    public NodePointer createPath(JXPathContext context) {
        if (!actual) {
            AbstractFactory factory = getAbstractFactory(context);
            if (!factory.declareVariable(context, name.toString())) {
                throw new JXPathException(
                    "Factory cannot define variable '"
                        + name
                        + "' for path: "
                        + asPath());
            }
View Full Code Here

                    this,
                    collection,
                    getName().toString(),
                    index);
            if (!success) {
                throw new JXPathException(
                    "Factory could not create object path: " + asPath());
            }
            setIndex(index);
        }
        return this;
View Full Code Here

    private Object createCollection(JXPathContext context, int index) {
        createPath(context);

        Object collection = getBaseValue();
        if (collection == null) {
            throw new JXPathException(
                "Factory did not assign a collection to variable '"
                    + name
                    + "' for path: "
                    + asPath());
        }

        if (index == WHOLE_COLLECTION) {
            index = 0;
        }
        else if (index < 0) {
            throw new JXPathException("Index is less than 1: " + asPath());
        }

        if (index >= getLength()) {
            collection = ValueUtils.expandCollection(collection, index + 1);
            variables.declareVariable(name.toString(), collection);
View Full Code Here

TOP

Related Classes of org.apache.commons.jxpath.JXPathException

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.