Package org.jdom

Examples of org.jdom.JDOMException


        Document document;
        Element root;

        document = parseRequestContent();
        if (document == null) {
            throw new JDOMException("Request content missing");
        }
        root = document.getRootElement();
        if( root == null || !root.getName().equals(rootName) ) {
            Domain.warn( "Root element must be "+rootName );
            throw new JDOMException("Root element must be <"+rootName+">");
        }
        return root;
    }
View Full Code Here


     *                           the request is not valid.
     */
    private void parseLockScope(Element lockScopeElement) throws JDOMException {
       
        if (lockScopeElement == null) {
            throw new JDOMException("Expected <"+E_LOCKSCOPE+"> element");
        }
       
        List children = lockScopeElement.getChildren();
        if (children.size() != 1) {
            throw new JDOMException("<"+E_LOCKSCOPE+"> must have exactly one child element");
        }
       
        lockInfo_lockScope = ((Element)children.get(0)).getName();
    }
View Full Code Here

     *                           the request is not valid.
     */
    private void parseLockType(Element lockTypeElement) throws JDOMException {
       
        if (lockTypeElement == null) {
            throw new JDOMException("Expected <"+E_LOCKTYPE+"> element");
        }
       
        List children = lockTypeElement.getChildren();
        if (children.size() != 1) {
            throw new JDOMException("<"+E_LOCKTYPE+"> must have exactly one child element");
        }
       
        lockInfo_lockType = ((Element)children.get(0)).getName();
    }
View Full Code Here

      if (content instanceof Element) {
        root = (Element) content;
      }
    }
    if (root == null) {
      throw new JDOMException("No root element found");
    }
   
    Document document = new Document();
    document.addContent(contents);
    document.setRootElement(root);
View Full Code Here

      try {
        translate(document.getRootElement());
      } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
        throw new JDOMException(
            "Error translating HTML fragment into DRI", e);
      }

      SAXFilter filter = new SAXFilter(contentHandler, lexicalHandler,
          namespaces);
View Full Code Here

      SAXBuilder xmlBuilder = new SAXBuilder(false);

      Document doc;
      try {
        doc = xmlBuilder.build(reader);
      } catch (Exception e) { throw new JDOMException("error building XML", e);}   

      return doc;
   }
View Full Code Here

  public static Document getJdomDocument(InputStream input)
      throws JDOMException, IOException {
    try {
      return new DOMBuilder().build(getDocument(input));
    } catch (SAXException e) {
      throw new JDOMException("couldn't parse xml", e);
    } catch (ParserConfigurationException e) {
      throw new JDOMException("could not configure parser", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.jdom.JDOMException

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.