Package org.apache.commons.jxpath

Examples of org.apache.commons.jxpath.JXPathException


                NodePointer ptr = (NodePointer) ctx.next();
                sum += InfoSetUtil.doubleValue(ptr);
            }
            return new Double(sum);
        }
        throw new JXPathException(
            "Invalid argument type for 'sum': " + v.getClass().getName());
    }
View Full Code Here


        return format.format(number);
    }

    private void assertArgCount(int count) {
        if (getArgumentCount() != count) {
            throw new JXPathException("Incorrect number of argument: " + this);
        }
    }
View Full Code Here

     *   determines which parser should be used to load the XML.
     */
    public DocumentContainer(URL xmlURL, String model) {
        this.xmlURL = xmlURL;
        if (xmlURL == null) {
            throw new JXPathException("XML URL is null");
        }
        this.model = model;
    }
View Full Code Here

                        stream.close();
                    }
                }
            }
            catch (Exception ex) {
                throw new JXPathException(
                    "Cannot read XML from: " + xmlURL.toString(),
                    ex);
            }
        }
        return document;
View Full Code Here

    private static final XMLParser getParser(String model) {
        XMLParser parser = (XMLParser) parsers.get(model);
        if (parser == null) {
            String className = (String) parserClasses.get(model);
            if (className == null) {
                throw new JXPathException("Unsupported XML model: " + model);
            }
            try {
                Class clazz = Class.forName(className);
                parser = (XMLParser) clazz.newInstance();
            }
            catch (Exception ex) {
                throw new JXPathException(
                    "Cannot allocate XMLParser: " + className);
            }
            parsers.put(model, parser);
        }
        return parser;
View Full Code Here

        try {
            SAXBuilder builder = new SAXBuilder();
            return builder.build(stream);
        }
        catch (Exception ex) {
            throw new JXPathException("JDOM parser error", ex);
        }
    }
View Full Code Here

            DocumentBuilderFactory factory =
                    DocumentBuilderFactory.newInstance();
            return factory.newDocumentBuilder().parse(stream);
        }
        catch (Exception ex) {
            throw new JXPathException("DOM parser error", ex);
        }
    }
View Full Code Here

        }
        catch (Throwable ex) {
            if (ex instanceof InvocationTargetException) {
                ex = ((InvocationTargetException) ex).getTargetException();
            }
            throw new JXPathException("Cannot invoke " + method, ex);
        }
    }
View Full Code Here

        }
        catch (Throwable ex) {
            if (ex instanceof InvocationTargetException) {
                ex = ((InvocationTargetException) ex).getTargetException();
            }
            throw new JXPathException(
                "Cannot invoke constructor " + constructor,
                ex);
        }
    }
View Full Code Here

                ((Collection) collection).add(null);
            }
            return collection;
        }
        else {
            throw new JXPathException(
                "Cannot turn "
                    + collection.getClass().getName()
                    + " into a collection of size "
                    + size);
        }
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.