Package com.robustaweb.library.commons.exception

Examples of com.robustaweb.library.commons.exception.XmlException


            if (contents.get(i) == content) {
                return i;
            }
        }

        throw new XmlException("can't find content " + content.getValue() + " in element " + parent.getName());

    }
View Full Code Here


    public String get(String nodeName) {
        Element elt = getElement(nodeName);

        //getElement() returns null if there is no such nodeName
        if (elt == null) {
            throw new XmlException("No nodeName '" + nodeName + "' found, or other exception");
        } else {
            // We check that it's VerySimpleXml
            if (elt.getChildren().size() > 0) {
                throw new XmlException("Bad use in RwtJdom.getValue() : The node :" + nodeName + " should not have any child ; it's not an expected Xml structure.");
            } else {
                return elt.getText();
            }
        }
    }
View Full Code Here

    public List<String> getValues(String nodeName) {
        List<Element> elements = getElements(nodeName);
        ArrayList<String> result = new ArrayList<String>();
        for (Element elt : elements) {
            if (elt.getChildren().size() > 0) {
                throw new XmlException("Illegal use : the node " + nodeName + "has " + elt.getChildren().size() + " Childrens");
            }
            result.add(elt.getText());
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of com.robustaweb.library.commons.exception.XmlException

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.