Package org.apache.commons.jxpath

Examples of org.apache.commons.jxpath.JXPathException


                it.remove();
            }
            return collection;
        }
        else {
            throw new JXPathException(
                "Cannot remove "
                    + collection.getClass().getName()
                    + "["
                    + index
                    + "]");
View Full Code Here


        Object value;
        try {
            Method method =
                getAccessibleMethod(propertyDescriptor.getReadMethod());
            if (method == null) {
                throw new JXPathException("No read method");
            }
            value = method.invoke(bean, new Object[0]);
        }
        catch (Exception ex) {
            throw new JXPathException(
                "Cannot access property: "
                    + (bean == null ? "null" : bean.getClass().getName())
                    + "."
                    + propertyDescriptor.getName(),
                ex);
View Full Code Here

    {
        try {
            Method method =
                getAccessibleMethod(propertyDescriptor.getWriteMethod());
            if (method == null) {
                throw new JXPathException("No write method");
            }
            value = convert(value, propertyDescriptor.getPropertyType());
            value = method.invoke(bean, new Object[] { value });
        }
        catch (Exception ex) {
            throw new JXPathException(
                "Cannot modify property: "
                    + (bean == null ? "null" : bean.getClass().getName())
                    + "."
                    + propertyDescriptor.getName(),
                ex);
View Full Code Here

    private static Object convert(Object value, Class type) {
        try {
            return TypeUtils.convert(value, type);
        }
        catch (Exception ex) {
            throw new JXPathException(
                "Cannot convert value of class "
                    + (value == null ? "null" : value.getClass().getName())
                    + " to type "
                    + type,
                ex);
View Full Code Here

                        bean,
                        new Object[] { new Integer(index)});
                }
            }
            catch (Exception ex) {
                throw new JXPathException(
                    "Cannot access property: " + propertyDescriptor.getName(),
                    ex);
            }
        }
View Full Code Here

        if (handler == null) {
            try {
                handler = (DynamicPropertyHandler) clazz.newInstance();
            }
            catch (Exception ex) {
                throw new JXPathException(
                    "Cannot allocate dynamic property handler of class "
                        + clazz.getName(),
                    ex);
            }
            dynamicPropertyHandlerMap.put(clazz, handler);
View Full Code Here

        }
    }

    public QName(String prefix, String localName) {
        if (localName.indexOf(':') != -1) {
            throw new JXPathException(
                "The 'localName' part of a QName cannot contain colons");
        }
        this.prefix = prefix;
        this.name = localName;
    }
View Full Code Here

     * of the parent contexts.  If there was an ongoing iteration over
     * this context, the method should not be called.
     */
    public NodeSet getNodeSet() {
        if (position != 0) {
            throw new JXPathException(
                "Simultaneous operations: "
                    + "should not request pointer list while "
                    + "iterating over an EvalContext");
        }
       
View Full Code Here

    /*
     * Check if the result is of the specified type
     */
    private void assertResultType(Exchange exchange, Object result) {
        if (result != null && !type.isAssignableFrom(result.getClass())) {
            throw new JXPathException("JXPath result type is " + result.getClass() + " instead of required type " + type);
        }
    }
View Full Code Here

        }
        if (value instanceof NodePointer) {
            value = ((NodePointer) value).getValue();
        }
        if (value == null) {
            throw new JXPathException("Predicate value is null");
        }

        if (value instanceof Number) {
            return (int) (InfoSetUtil.doubleValue(value) + 0.5) - 1;
        }
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.