Package org.jdom

Examples of org.jdom.JDOMException


     *                           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

        Iterator i = parseRequestContent(E_UPDATE).getChildren().iterator();
        while( i.hasNext() ) {
            Element e = (Element)i.next();
            if( e.getName().equals(E_VERSION) ) {
                if( updateSourcePath != null ) {
                    throw new JDOMException("At most one &lt;"+E_VERSION+"&gt; element allowed" );
                }
                if (updateLabelName != null) {
                    throw new JDOMException("Either a &lt;"+E_VERSION+"&gt; OR a &lt;"+E_LABEL_NAME+"&gt; element allowed");
                }
                // get the href element
                ve = e;
                try {
                    Element hre = (Element)ve.getChildren().get(0);
                    if( hre == null || !hre.getName().equals(E_HREF) )
                        throw new Exception();
                    updateSourcePath = getSlidePath( hre.getText() );
                }
                catch( Exception x ) {
                    throw new JDOMException("&lt;"+E_VERSION+"&gt; element must contain &lt;"+E_HREF+"&gt; element" );
                }
            }
            if( e.getName().equals(E_PROP) ) {
                if( requestedProps != null ) {
                    throw new JDOMException("At most one "+E_PROP+" element allowed" );
                }
                requestedProps = new RequestedPropertiesImpl( e );
            }
            if( e.getName().equals(E_LABEL_NAME) ) {
                if (updateSourcePath != null) {
                    throw new JDOMException("Either a &lt;"+E_VERSION+"&gt; OR a &lt;"+E_LABEL_NAME+"&gt; element allowed");
                }
                if( updateLabelName != null ) {
                    throw new JDOMException("At most one &lt;"+E_LABEL_NAME+"&gt; element allowed" );
                }
                updateLabelName = e.getText();
            }
        }
    }
View Full Code Here

                                throw new Exception();
                            existingVersionPath = getSlidePath( hre.getText() );
                        }
                        catch( Exception x ) {
                            Domain.warn( E_VERSION+" element must contain "+E_HREF+" element" );
                            throw new JDOMException("<"+E_VERSION+"> element must contain <"+E_HREF+"> element" );
                        }
                        break;
                    }
                }
            }
View Full Code Here

        }
        catch (IOException e) {
            throw e;
        }
        catch (Exception e) {
            throw new JDOMException("Failed to parse schema \"" + this.uri +
                                    "\": " + e.getMessage(), e);
        }
    }
View Full Code Here

    private Verifier newVerifier() throws JDOMException {
        try {
            return this.compiledSchema.newVerifier();
        }
        catch (VerifierConfigurationException e) {
            throw new JDOMException(
                    "Failed to allocate schema verifier: " + e.getMessage(), e);
        }
    }
View Full Code Here

            System.out.println("   " + expression +
                                        " -> XPath = " + testPattern);
         }
      }
      catch (RESyntaxException ex1) {
         throw (new JDOMException(
                        "Illegal XPath expression: " + expression, ex1));
      }
   }
View Full Code Here

    * @throws JDOMException  if one of the arguments is invalid.
    */
   protected XPathMatcher(String expression, ElementListener listener)
                                                        throws JDOMException {
      if ((expression == null) || (expression.length() == 0)) {
         throw (new JDOMException(
                        "Invalid XPath expression: \"" + expression + "\""));
      }
      if (listener == null) {
         throw (new JDOMException("Invalid ElementListener: <null>"));
      }
      this.expression = expression;
      this.listener   = listener;
   }
View Full Code Here

               // => Get the constructor to use.
               constructor = aClass.getConstructor(
                        new Class[] { String.class, ElementListener.class });
            }
            else {
               throw (new JDOMException(
                        aClass.getName() + " is not a concrete XPathMatcher"));
            }
         }
         catch (Exception ex1) {
            // Any reflection error (probably due to a configuration mistake).
            throw (new JDOMException(ex1.toString(), ex1));
         }
      }
      else {
         throw (new IllegalArgumentException("aClass"));
      }
View Full Code Here

      catch (InvocationTargetException ex1) {
         // Constructor threw an error on invocation.
         Throwable te = ex1.getTargetException();

         throw ((te instanceof JDOMException)? (JDOMException)te:
                                        new JDOMException(te.toString(), te));
      }
      catch (Exception ex3) {
         // Any reflection error (probably due to a configuration mistake).
         throw (new JDOMException(ex3.toString(), ex3));
      }
   }
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.