public OMNode detach() throws OMException { if (this.parentNode == null) { throw new OMException("Parent level elements cannot be detached"); } else { if (!done) { build(); } if (previousSibling == null) { // This is the first child if (nextSibling != null) { this.parentNode.setFirstChild(nextSibling); } else { this.parentNode.firstChild = null; this.parentNode.lastChild = null; } } else { this.previousSibling.setNextOMSibling(nextSibling); if (nextSibling == null) { this.previousSibling.parentNode.done = true; } } if (this.nextSibling != null) { this.nextSibling.setPreviousOMSibling(this.previousSibling); } if (this.parentNode != null && this.parentNode.lastChild == this) { this.parentNode.lastChild = previousSibling; } this.parentNode = null; } return this; }
public Node cloneNode(boolean deep) { ParentNode newnode = (ParentNode) super.cloneNode(deep); // set owner document newnode.ownerNode = ownerNode; // Need to break the association w/ original kids newnode.firstChild = null; newnode.lastChild = null; // Then, if deep, clone the kids too. if (deep) { for (ChildNode child = firstChild; child != null; child = child.nextSibling) { newnode.appendChild(child.cloneNode(true)); } } return newnode; }
public void setRoleValue(String uri) { if (firstChild != null) { firstChild.detach(); } this.setText(uri); }
/** Inserts the given sibling before this item. */ public void insertSiblingBefore(OMNode sibling) throws OMException { // ((OMNodeEx)sibling).setParent(this.parentNode); if (this == sibling) { throw new OMException("Inserting self as the sibling is not allowed"); } if (sibling instanceof ChildNode) { // ChildNode domSibling = (ChildNode)sibling; // domSibling.nextSibling = this; // if(this.previousSibling != null) { // this.previousSibling.nextSibling = domSibling; // } // domSibling.previousSibling = this.previousSibling; // this.previousSibling = domSibling; ChildNode siblingImpl = (ChildNode) sibling; siblingImpl.nextSibling = this; if (previousSibling == null) { this.parentNode.setFirstChild(siblingImpl); siblingImpl.previousSibling = null; } else { siblingImpl.setParent(this.parentNode); previousSibling.setNextOMSibling(siblingImpl); siblingImpl.setPreviousOMSibling(previousSibling); } previousSibling = siblingImpl; } else { throw new OMException("The given child is not of type " + ChildNode.class); } }
&& !(this.ownerNode == newDomChild.getOwnerDocument())) { throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, DOMMessageFormatter.formatMessage( this.firstChild.isFirstChild(true); newDomChild.setParent(this); } else { this.lastChild.nextSibling = newDomChild; refDomChild.previousSibling = newDomChild; this.firstChild.isFirstChild(true); refDomChild.isFirstChild(false);
while (child != null && ((!(child instanceof OMElement)) || child .isComplete())) { child.internalSerializeAndConsume(writer); child = child.nextSibling;
public void internalSerialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException { // select the builder short builderType = PULL_TYPE_BUILDER; // default is pull type if (builder != null) { builderType = this.builder.getBuilderType(); } if ((builderType == PUSH_TYPE_BUILDER) && (builder.getRegisteredContentHandler() == null)) { builder.registerExternalContentHandler( new StreamWriterToContentHandlerConverter(writer)); } OMSerializerUtil.serializeStartpart(this, SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, writer); writer.writeCharacters(this.getText()); if (firstChild != null) { firstChild.internalSerializeAndConsume(writer); } writer.writeEndElement(); }
public void build() { if (this.firstChild != null && !this.firstChild.done) { this.firstChild.build(); } this.done = true; }
public Node getNextSibling() { return (Node) this.getNextOMSibling(); }
public Node cloneNode(boolean deep) { ChildNode newnode = (ChildNode) super.cloneNode(deep); // Need to break the association w/ original kids newnode.previousSibling = null; newnode.nextSibling = null; newnode.isFirstChild(false); newnode.parentNode = null; return newnode; }
firstChild.internalSerializeAndConsume(writer); OMSerializerUtil.serializeEndpart(writer); } else if (!this.done) {
firstChild.internalSerializeAndConsume(writer); OMSerializerUtil.serializeEndpart(writer); } else if (!this.done) {
firstChild.internalSerializeAndConsume(writer); OMSerializerUtil.serializeEndpart(writer); } else if (!this.done) {