Package org.dom4j

Examples of org.dom4j.IllegalAddException


/*      */
/*      */   public void add(Attribute attribute) {
/*  626 */     if (attribute.getParent() != null) {
/*  627 */       String message = "The Attribute already has an existing parent \"" + attribute.getParent().getQualifiedName() + "\"";
/*      */
/*  630 */       throw new IllegalAddException(this, attribute, message);
/*      */     }
/*      */
/*  633 */     if (attribute.getValue() == null)
/*      */     {
/*  637 */       Attribute oldAttribute = attribute(attribute.getQName());
View Full Code Here


/*  836 */       localName = name.substring(index + 1);
/*      */
/*  838 */       namespace = getNamespaceForPrefix(prefix);
/*      */
/*  840 */       if (namespace == null) {
/*  841 */         throw new IllegalAddException("No such namespace prefix: " + prefix + " is in scope on: " + this + " so cannot add element: " + name);
/*      */       }
/*      */     }
/*      */     else
/*      */     {
/*  846 */       namespace = getNamespaceForPrefix("");
View Full Code Here

/*      */   protected void addNode(Node node) {
/* 1516 */     if (node.getParent() != null)
/*      */     {
/* 1518 */       String message = "The Node already has an existing parent of \"" + node.getParent().getQualifiedName() + "\"";
/*      */
/* 1521 */       throw new IllegalAddException(this, node, message);
/*      */     }
/*      */
/* 1524 */     addNewNode(node);
/*      */   }
View Full Code Here

/*      */   protected void addNode(int index, Node node) {
/* 1528 */     if (node.getParent() != null)
/*      */     {
/* 1530 */       String message = "The Node already has an existing parent of \"" + node.getParent().getQualifiedName() + "\"";
/*      */
/* 1533 */       throw new IllegalAddException(this, node, message);
/*      */     }
/*      */
/* 1536 */     addNewNode(index, node);
/*      */   }
View Full Code Here

/*     */
/* 234 */           if ((node instanceof Element)) {
/* 235 */             if (this.rootElement == null)
/* 236 */               this.rootElement = ((Element)node);
/*     */             else {
/* 238 */               throw new IllegalAddException("A document may only contain one root element: " + content);
/*     */             }
/*     */
/*     */           }
/*     */
/* 245 */           newContent.add(node);
View Full Code Here

/*     */
/* 282 */       if ((document != null) && (document != this))
/*     */       {
/* 284 */         String message = "The Node already has an existing document: " + document;
/*     */
/* 286 */         throw new IllegalAddException(this, node, message);
/*     */       }
/*     */
/* 289 */       contentList().add(node);
/* 290 */       childAdded(node);
/*     */     }
View Full Code Here

/*     */
/* 298 */       if ((document != null) && (document != this))
/*     */       {
/* 300 */         String message = "The Node already has an existing document: " + document;
/*     */
/* 302 */         throw new IllegalAddException(this, node, message);
/*     */       }
/*     */
/* 305 */       contentList().add(index, node);
/* 306 */       childAdded(node);
/*     */     }
View Full Code Here

/*      */
/*      */   public void add(Attribute attribute) {
/*  828 */     if (attribute.getParent() != null) {
/*  829 */       String message = "The Attribute already has an existing parent \"" + attribute.getParent().getQualifiedName() + "\"";
/*      */
/*  832 */       throw new IllegalAddException(this, attribute, message);
/*      */     }
/*      */
/*  835 */     if (attribute.getValue() == null)
/*      */     {
/*  839 */       Attribute oldAttribute = attribute(attribute.getQName());
View Full Code Here

/*     */
/*     */   protected Node asNode(Object object) {
/* 151 */     if ((object instanceof Node)) {
/* 152 */       return (Node)object;
/*     */     }
/* 154 */     throw new IllegalAddException("This list must contain instances of Node. Invalid type: " + object);
/*     */   }
View Full Code Here

/*     */     }
/*     */   }
/*     */
/*     */   protected void invalidNodeTypeAddException(Node node)
/*     */   {
/* 453 */     throw new IllegalAddException("Invalid node type. Cannot add node: " + node + " to this branch: " + this);
/*     */   }
View Full Code Here

TOP

Related Classes of org.dom4j.IllegalAddException

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.