Hi Folks,
I propose the attached patch where the SOAPFactory implementation
class name can be set in the Options and in the MEPClient, we check
whether this
property is set in its Option attribute, and if so calls the newly
added OMAbstractFactory#getSOAPFactory(String soapFactory) method.
This way, we can make it work with different SOAPFactory
implementations.
Regards
Azeez
On 12/29/05, Afkham Azeez <[EMAIL PROTECTED]> wrote:
> Hi Folks,
> I'm having this issue with SAAJ over DOOM where I try to call the
> org.apache.axis2.client.Call #invokeBlocking(String axisop, OMElement
> toSend) method.
>
> The issue is with MEPClient#prepareTheSOAPEnvelope(OMElement toSend),
> where it calls OMAbstractFactory.getSOAP12Factory().getDefaultEnvelope()
> or OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope(). This
> call returns a "org.apache.axis2.soap.impl.llom.soap11.SOAP12Factory"
> or "org.apache.axis2.soap.impl.llom.soap11.SOAP11Factory". So, the
> returned factory is an LLOM implementation. Hence we cannot use the
> call class with DOOM!!! As a fix, we can modify the code so that we
> may pass in the soap factory class as a string and based on that, to
> return the relevant SOAPFactory.
>
> What are your thoughts?
>
> --
> Thanks
> Afkham Azeez
>
--
Thanks
Afkham Azeez
Index: modules/xml/src/org/apache/axis2/om/FactoryFinder.java
===================================================================
--- modules/xml/src/org/apache/axis2/om/FactoryFinder.java (revision 359755)
+++ modules/xml/src/org/apache/axis2/om/FactoryFinder.java (working copy)
@@ -50,12 +50,12 @@
String factoryClassName = factoryClass;
//first look for a java system property
- if (System.getProperty(systemPropertyName) != null) {
+ if (systemPropertyName != null &&
+ System.getProperty(systemPropertyName) != null) {
factoryClassName = systemPropertyName;
}
- ;
- Object factory = null;
+ Object factory;
try {
if (loader == null) {
factory = Class.forName(factoryClassName).newInstance();
@@ -82,8 +82,8 @@
public static SOAPFactory findSOAP11Factory(ClassLoader loader)
throws OMFactoryException {
return (SOAPFactory) findFactory(loader,
- DEFAULT_SOAP11_FACTORY_CLASS_NAME,
- SOAP11_FACTORY_NAME_PROPERTY);
+ DEFAULT_SOAP11_FACTORY_CLASS_NAME,
+ SOAP11_FACTORY_NAME_PROPERTY);
}
/**
@@ -100,8 +100,8 @@
public static SOAPFactory findSOAP12Factory(ClassLoader loader)
throws OMFactoryException {
return (SOAPFactory) findFactory(loader,
- DEFAULT_SOAP12_FACTORY_CLASS_NAME,
- SOAP12_FACTORY_NAME_PROPERTY);
+ DEFAULT_SOAP12_FACTORY_CLASS_NAME,
+ SOAP12_FACTORY_NAME_PROPERTY);
}
/**
@@ -118,7 +118,20 @@
public static OMFactory findOMFactory(ClassLoader loader)
throws OMFactoryException {
return (OMFactory) findFactory(loader,
- DEFAULT_OM_FACTORY_CLASS_NAME,
- OM_FACTORY_NAME_PROPERTY);
+ DEFAULT_OM_FACTORY_CLASS_NAME,
+ OM_FACTORY_NAME_PROPERTY);
}
+
+ /**
+ *
+ * @param classLoader
+ * @param soapFactory
+ * @return The SOAPFactory
+ */
+ public static SOAPFactory findSOAPFactory(final ClassLoader classLoader,
+ final String soapFactory) {
+ return (SOAPFactory) findFactory(classLoader,
+ soapFactory,
+ null);
+ }
}
Index: modules/xml/src/org/apache/axis2/om/OMAbstractFactory.java
===================================================================
--- modules/xml/src/org/apache/axis2/om/OMAbstractFactory.java (revision 359755)
+++ modules/xml/src/org/apache/axis2/om/OMAbstractFactory.java (working copy)
@@ -50,6 +50,28 @@
}
/**
+ * This will pick up the provided <code>soapFactory</code> factory implementation from the classpath
+ *
+ * @param soapFactory Fully qualified SOAP 1.1 or SOAP 1.2 Factory implementation class name
+ * @return The SOAP 1.1 or 1.2 Factory implementation instance corresponding to <code>soapFactory</code>
+ */
+ public static SOAPFactory getSOAPFactory(String soapFactory) {
+ return FactoryFinder.findSOAPFactory(null, soapFactory);
+ }
+
+ /**
+ * This will pick up the provided <code>soapFactory</code> factory implementation using the provided
+ * <code>classLoader</code>
+ *
+ * @param classLoader
+ * @param soapFactory Fully qualified SOAP 1.1 or SOAP 1.2 Factory implementation class name
+ * @return The SOAP 1.1 or 1.2 Factory implementation instance corresponding to <code>soapFactory</code>
+ */
+ public static SOAPFactory getSOAPFactory(ClassLoader classLoader, String soapFactory) {
+ return FactoryFinder.findSOAPFactory(classLoader, soapFactory);
+ }
+
+ /**
* This will pick up the default factory implementation from the classpath
*
* @return
@@ -98,6 +120,8 @@
* So this method is to solve the chicken and egg problem, we have. If you do not know the SOAP version to be used
* to process a particluar SOAP message you have recd, use this method to buid the SOAP envelope, and then extract the SOAP
* version from that envlope and switch to the proper factory using that.
+ *
+ * @deprecated
*/
public static SOAPFactory getDefaultSOAPFactory() {
return new SOAPLinkedListImplFactory();
Index: modules/core/src/org/apache/axis2/client/MEPClient.java
===================================================================
--- modules/core/src/org/apache/axis2/client/MEPClient.java (revision 359755)
+++ modules/core/src/org/apache/axis2/client/MEPClient.java (working copy)
@@ -174,8 +174,11 @@
}
String soapVersionURI = clientOptions.getSoapVersionURI();
+ String soapFactory = clientOptions.getSoapFactory();
- if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapVersionURI)) {
+ if(soapFactory != null && soapFactory.trim().length() != 0){
+ return OMAbstractFactory.getSOAPFactory(soapFactory).getDefaultEnvelope();
+ } else if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapVersionURI)) {
return OMAbstractFactory.getSOAP12Factory().getDefaultEnvelope();
} else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapVersionURI)
|| "".equals(soapVersionURI) || (soapVersionURI == null)) {
@@ -243,7 +246,7 @@
protected void inferTransportOutDescription(MessageContext msgCtx) throws AxisFault {
// user can set the transport by giving a TransportOutDescription or we
- // will deduce that from the "to" epr information, if user has not set the
+ // will deduce that from the "to" epr information, if user has not set the
// TransportOutDescription, lets infer that
if (clientOptions.getSenderTransport() == null) {
AxisConfiguration axisConfig =
Index: modules/core/src/org/apache/axis2/client/Options.java
===================================================================
--- modules/core/src/org/apache/axis2/client/Options.java (revision 359755)
+++ modules/core/src/org/apache/axis2/client/Options.java (working copy)
@@ -53,6 +53,7 @@
private Boolean isExceptionToBeThrownOnSOAPFault; // defaults to true;
private long timeOutInMilliSeconds = -1; // = DEFAULT_TIMEOUT_MILLISECONDS;
private Boolean useSeparateListener; // defaults to false
+ private String soapFactory;
// Addressing specific properties
private String action;
@@ -211,6 +212,14 @@
return soapVersionURI == null ? SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI : soapVersionURI;
}
+ public String getSoapFactory() {
+ if (soapFactory == null && parent != null) {
+ soapFactory = parent.getSoapFactory();
+ }
+
+ return soapFactory == null ? "" : soapFactory;
+ }
+
/**
* Gets the wait time after which a client times out in a blocking scenario.
* The default is Options#DEFAULT_TIMEOUT_MILLISECONDS
@@ -304,6 +313,10 @@
this.messageId = messageId;
}
+ public void setSoapFactory(String soapFactory) {
+ this.soapFactory = soapFactory;
+ }
+
/**
* This will set the properties to the context. But in setting that one may need to "copy" all
* the properties from the source properties to the target properties. To enable this we introduced
@@ -405,7 +418,7 @@
if (!useSeparateListener) {
boolean isTransportsEqual = senderTransport.equals(listenerTransport);
boolean isATwoWaytransport = Constants.TRANSPORT_HTTP.equals(senderTransport)
- || Constants.TRANSPORT_TCP.equals(senderTransport);
+ || Constants.TRANSPORT_TCP.equals(senderTransport);
if ((!isTransportsEqual || !isATwoWaytransport)) {
throw new AxisFault(Messages.getMessage("useSeparateListenerLimited"));
Index: modules/saaj/test/org/apache/axis2/saaj/AttachmentTest.java
===================================================================
--- modules/saaj/test/org/apache/axis2/saaj/AttachmentTest.java (revision 359755)
+++ modules/saaj/test/org/apache/axis2/saaj/AttachmentTest.java (working copy)
@@ -19,46 +19,46 @@
public AttachmentTest(String name) {
super(name);
}
-
+
public void testStringAttachment() throws Exception {
- SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
- SOAPConnection con = scFactory.createConnection();
-
- MessageFactory factory = MessageFactory.newInstance();
- SOAPMessage message = factory.createMessage();
- AttachmentPart attachment = message.createAttachmentPart();
- String stringContent = "Update address for Sunny Skies " +
- "Inc., to 10 Upbeat Street, Pleasant Grove, CA 95439";
-
- attachment.setContent(stringContent, "text/plain");
- attachment.setContentId("update_address");
- message.addAttachmentPart(attachment);
-
- assertTrue(message.countAttachments()==1);
-
- java.util.Iterator it = message.getAttachments();
- while (it.hasNext()) {
- attachment = (AttachmentPart) it.next();
- Object content = attachment.getContent();
- String id = attachment.getContentId();
- System.out.println("Attachment " + id + " contains: " + content);
- assertEquals(content,stringContent);
- }
- System.out.println("Here is what the XML message looks like:");
- message.writeTo(System.out);
-
- message.removeAllAttachments();
- assertTrue(message.countAttachments()==0);
+ SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
+ SOAPConnection con = scFactory.createConnection();
+
+ MessageFactory factory = MessageFactory.newInstance();
+ SOAPMessage message = factory.createMessage();
+ AttachmentPart attachment = message.createAttachmentPart();
+ String stringContent = "Update address for Sunny Skies " +
+ "Inc., to 10 Upbeat Street, Pleasant Grove, CA 95439";
+
+ attachment.setContent(stringContent, "text/plain");
+ attachment.setContentId("update_address");
+ message.addAttachmentPart(attachment);
+
+ assertTrue(message.countAttachments() == 1);
+
+ java.util.Iterator it = message.getAttachments();
+ while (it.hasNext()) {
+ attachment = (AttachmentPart) it.next();
+ Object content = attachment.getContent();
+ String id = attachment.getContentId();
+ System.out.println("Attachment " + id + " contains: " + content);
+ assertEquals(content, stringContent);
+ }
+ System.out.println("Here is what the XML message looks like:");
+ message.writeTo(System.out);
+
+ message.removeAllAttachments();
+ assertTrue(message.countAttachments() == 0);
}
-
+
public void testMultipleAttachments() throws Exception {
SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
SOAPConnection con = scFactory.createConnection();
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage msg = factory.createMessage();
- java.net.URL url1 = new java.net.URL("http://slashdot.org/slashdot.xml");
- java.net.URL url2 = new java.net.URL("http://www.apache.org/LICENSE.txt");
+ java.net.URL url1 = new java.net.URL("http://www.apache.org/licenses/LICENSE-2.0.html");
+ java.net.URL url2 = new java.net.URL("http://www.apache.org/licenses/LICENSE-2.0.txt");
AttachmentPart a1 = msg.createAttachmentPart(new javax.activation.DataHandler(url1));
a1.setContentType("text/xml");
@@ -70,54 +70,58 @@
a3.setContentType("text/plain");
msg.addAttachmentPart(a3);
- assertTrue(msg.countAttachments()==3);
+ assertTrue(msg.countAttachments() == 3);
javax.xml.soap.MimeHeaders mimeHeaders = new javax.xml.soap.MimeHeaders();
mimeHeaders.addHeader("Content-Type", "text/xml");
int nAttachments = 0;
java.util.Iterator iterator = msg.getAttachments(mimeHeaders);
- while (iterator.hasNext()) {
+ while (iterator.hasNext()) {
nAttachments++;
- AttachmentPart ap = (AttachmentPart)iterator.next();
- assertTrue(ap.equals(a1) || ap.equals(a2));
- }
- assertTrue(nAttachments==2);
+ AttachmentPart ap = (AttachmentPart) iterator.next();
+ assertTrue(ap.equals(a1) || ap.equals(a2));
+ }
+ assertTrue(nAttachments == 2);
}
-
+
public void testBadAttSize() throws Exception {
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
- ByteArrayInputStream ins=new ByteArrayInputStream(new byte[5]);
- DataHandler dh=new DataHandler(new Src(ins,"text/plain"));
+ ByteArrayInputStream ins = new ByteArrayInputStream(new byte[5]);
+ DataHandler dh = new DataHandler(new Src(ins, "text/plain"));
AttachmentPart part = message.createAttachmentPart(dh);
- assertEquals("Size should match",5,part.getSize());
+ assertEquals("Size should match", 5, part.getSize());
}
- class Src implements DataSource{
+ class Src implements DataSource {
InputStream m_src;
String m_type;
- public Src(InputStream data, String type){
- m_src=data;
- m_type=type;
+ public Src(InputStream data, String type) {
+ m_src = data;
+ m_type = type;
}
- public String getContentType(){
+
+ public String getContentType() {
return m_type;
}
- public InputStream getInputStream() throws IOException{
+
+ public InputStream getInputStream() throws IOException {
m_src.reset();
return m_src;
}
- public String getName(){
+
+ public String getName() {
return "Some-Data";
}
- public OutputStream getOutputStream(){
+
+ public OutputStream getOutputStream() {
throw new UnsupportedOperationException("I don't give output streams");
}
}
-
+
public static void main(String[] args) throws Exception {
AttachmentTest tester = new AttachmentTest("TestSAAJ");
tester.testMultipleAttachments();
Index: modules/saaj/src/org/apache/axis2/om/impl/dom/ParentNode.java
===================================================================
--- modules/saaj/src/org/apache/axis2/om/impl/dom/ParentNode.java (revision 359755)
+++ modules/saaj/src/org/apache/axis2/om/impl/dom/ParentNode.java (working copy)
@@ -53,21 +53,21 @@
// /
// /OMContainer methods
///
-
+
public void addChild(OMNode omNode) {
this.appendChild((Node)omNode);
}
-
-
+
+
public void buildNext() {
if(!this.done)
builder.next();
}
-
+
public Iterator getChildren() {
return new OMChildrenIterator(this.firstChild);
}
-
+
/**
* Returns an iterator of child nodes having a given qname
* @see org.apache.axis2.om.OMContainer#getChildrenWithName(javax.xml.namespace.QName)
@@ -76,7 +76,7 @@
return new OMChildrenQNameIterator(getFirstOMChild(),
elementQName);
}
-
+
/**
* Return the first OMElement child node
* @see org.apache.axis2.om.OMContainer#getFirstChildWithName(javax.xml.namespace.QName)
@@ -87,7 +87,7 @@
elementQName);
while (children.hasNext()) {
OMNode node = (OMNode) children.next();
-
+
//Return the first OMElement node that is found
if(node instanceof OMElement) {
return (OMElement)node;
@@ -95,44 +95,44 @@
}
return null;
}
-
+
public OMNode getFirstOMChild() {
while ((firstChild == null) && !done) {
buildNext();
}
return firstChild;
}
-
+
public void setFirstChild(OMNode omNode) {
if (firstChild != null) {
((OMNodeEx) omNode).setParent(this);
}
this.firstChild = (ChildNode)omNode;
}
-
-
+
+
///
///DOM Node methods
///
-
+
public NodeList getChildNodes() {
- if (!this.done) {
- this.build();
- }
- return new NodeListImpl(this, null,null);
+ if(!this.done){
+ this.build();
+ }
+ return new NodeListImpl(this, null,null);
}
-
+
public Node getFirstChild() {
return (Node)this.getFirstOMChild();
}
-
+
public Node getLastChild() {
if(!this.done) {
this.build();
}
return this.lastChild;
}
-
+
public boolean hasChildNodes() {
while ((firstChild == null) && !done) {
buildNext();
Index: modules/saaj/src/org/apache/axis2/om/impl/dom/ChildNode.java
===================================================================
--- modules/saaj/src/org/apache/axis2/om/impl/dom/ChildNode.java (revision 359755)
+++ modules/saaj/src/org/apache/axis2/om/impl/dom/ChildNode.java (working copy)
@@ -19,156 +19,160 @@
import org.apache.axis2.om.OMException;
import org.apache.axis2.om.OMNode;
import org.apache.axis2.om.impl.OMNodeEx;
+import org.apache.axis2.om.impl.llom.OMNodeImpl;
import org.w3c.dom.Node;
public abstract class ChildNode extends NodeImpl {
- protected ChildNode previousSibling;
-
- protected ChildNode nextSibling;
-
- protected ParentNode parentNode;
-
-
- /**
- * @param ownerNode
- */
- protected ChildNode(DocumentImpl ownerDocument) {
- super(ownerDocument);
- }
-
- protected ChildNode() {
-
- }
-
- public OMNode getNextOMSibling() throws OMException {
+ protected ChildNode previousSibling;
+
+ protected ChildNode nextSibling;
+
+ protected ParentNode parentNode;
+
+
+ /**
+ * @param ownerDocument
+ */
+ protected ChildNode(DocumentImpl ownerDocument) {
+ super(ownerDocument);
+ }
+
+ protected ChildNode() {
+
+ }
+
+ public OMNode getNextOMSibling() throws OMException {
while ((nextSibling == null) && !this.parentNode.done) {
this.parentNode.buildNext();
}
return nextSibling;
- }
- public Node getNextSibling() {
- return (Node)this.getNextOMSibling();
- }
- public OMNode getPreviousOMSibling() {
- return this.previousSibling;
- }
- public Node getPreviousSibling() {
- return this.previousSibling;
- }
+ }
- ///
- ///OMNode methods
- ///
- public void setNextOMSibling(OMNode node) {
- if(node instanceof ChildNode)
- this.nextSibling = (ChildNode)node;
- else
- throw new OMException("The node is not a " + ChildNode.class);
- }
+ public Node getNextSibling() {
+ return (Node) this.getNextOMSibling();
+ }
- public void setPreviousOMSibling(OMNode node) {
- if(node instanceof ChildNode)
- this.previousSibling = (ChildNode)node;
- else
- throw new OMException("The node is not a " + ChildNode.class);
- }
-
- public OMContainer getParent() throws OMException {
- return (OMContainer)this.parentNode;
- }
-
- public Node getParentNode() {
- return this.parentNode;
- }
-
- public void setParent(OMContainer element) {
- if(element instanceof ParentNode)
- this.parentNode = (ParentNode)element;
- else
- throw new OMException("The given parent is not of the type " + ParentNode.class);
+ public OMNode getPreviousOMSibling() {
+ return this.previousSibling;
+ }
- }
-
- public OMNode detach() throws OMException{
- if(this.parentNode == null) {
- throw new OMException("Parent level elements cannot be ditached");
- } else {
- 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 {
- ((OMNodeEx)this.getPreviousOMSibling()).setNextOMSibling(nextSibling);
- } if (this.nextSibling != null) {
- this.nextSibling.setPreviousOMSibling(this.previousSibling);
- }
- this.parentNode = null;
- }
- return this;
- }
-
- public void discard() throws OMException {
- throw new UnsupportedOperationException("Cannot discard this node");
- }
-
- /**
- * Insert the given sibling next to this item
- */
- public void insertSiblingAfter(OMNode sibling) throws OMException {
-
- if(this.parentNode != null) {
- ((OMNodeEx)sibling).setParent(this.parentNode);
- }
-
- if(sibling instanceof ChildNode) {
- ChildNode domSibling = (ChildNode)sibling;
- domSibling.previousSibling = this;
- if(this.nextSibling != null) {
- this.nextSibling.previousSibling = domSibling;
- }
- domSibling.nextSibling = this.nextSibling;
- this.nextSibling = domSibling;
-
- } else {
- throw new OMException("The given child is not of type " + ChildNode.class);
- }
- }
-
- /**
- * Insert the given sibling before this item
- */
- public void insertSiblingBefore(OMNode sibling) throws OMException {
- ((OMNodeEx)sibling).setParent(this.parentNode);
- 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;
-
- } else {
- throw new OMException("The given child is not of type " + ChildNode.class);
- }
-
- }
-
-
+ public Node getPreviousSibling() {
+ return this.previousSibling;
+ }
+
+ ///
+ ///OMNode methods
+ ///
+ public void setNextOMSibling(OMNode node) {
+ if (node instanceof ChildNode)
+ this.nextSibling = (ChildNode) node;
+ else
+ throw new OMException("The node is not a " + ChildNode.class);
+ }
+
+ public void setPreviousOMSibling(OMNode node) {
+ if (node instanceof ChildNode)
+ this.previousSibling = (ChildNode) node;
+ else
+ throw new OMException("The node is not a " + ChildNode.class);
+ }
+
+ public OMContainer getParent() throws OMException {
+ return this.parentNode;
+ }
+
+ public Node getParentNode() {
+ return this.parentNode;
+ }
+
+ public void setParent(OMContainer element) {
+ if (element instanceof ParentNode) {
+ this.parentNode = (ParentNode) element;
+ } else {
+ throw new OMException("The given parent is not of the type " + ParentNode.class);
+ }
+ }
+
+ public OMNode detach() throws OMException {
+ if (this.parentNode == null) {
+ throw new OMException("Parent level elements cannot be detached");
+ } else {
+ 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 if (nextSibling != null) {
+ ((OMNodeEx) this.getPreviousOMSibling()).setNextOMSibling(nextSibling);
+ }
+ if (this.nextSibling != null) {
+ this.nextSibling.setPreviousOMSibling(this.previousSibling);
+ }
+ this.parentNode = null;
+ }
+ return this;
+ }
+
+ public void discard() throws OMException {
+ throw new UnsupportedOperationException("Cannot discard this node");
+ }
+
+ /**
+ * Insert the given sibling next to this item
+ */
+ public void insertSiblingAfter(OMNode sibling) throws OMException {
+
+ if (this.parentNode != null) {
+ ((OMNodeEx) sibling).setParent(this.parentNode);
+ }
+
+ if (sibling instanceof ChildNode) {
+ ChildNode domSibling = (ChildNode) sibling;
+ domSibling.previousSibling = this;
+ if (this.nextSibling != null) {
+ this.nextSibling.previousSibling = domSibling;
+ }
+ domSibling.nextSibling = this.nextSibling;
+ this.nextSibling = domSibling;
+
+ } else {
+ throw new OMException("The given child is not of type " + ChildNode.class);
+ }
+ }
+
+ /**
+ * Insert the given sibling before this item
+ */
+ public void insertSiblingBefore(OMNode sibling) throws OMException {
+ ((OMNodeEx) sibling).setParent(this.parentNode);
+ 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;
+
+ } else {
+ throw new OMException("The given child is not of type " + ChildNode.class);
+ }
+
+ }
+
public Node cloneNode(boolean deep) {
- ChildNode newnode = (ChildNode) super.cloneNode(deep);
-
+ ChildNode newnode = (ChildNode) super.cloneNode(deep);
+
// Need to break the association w/ original kids
- newnode.previousSibling = null;
- newnode.nextSibling = null;
+ newnode.previousSibling = null;
+ newnode.nextSibling = null;
newnode.isFirstChild(false);
- return newnode;
+ return newnode;
}
}
Index: modules/saaj/test-resources/Echo.aar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream