abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r550691 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
Date Tue, 26 Jun 2007 05:05:01 GMT
Author: jmsnell
Date: Mon Jun 25 22:05:00 2007
New Revision: 550691

URL: http://svn.apache.org/viewvc?view=rev&rev=550691
Log:
Bug fix.  Content setValueElement/getValueElement is not properly handling ElementWrapper
instances

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?view=diff&rev=550691&r1=550690&r2=550691
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
Mon Jun 25 22:05:00 2007
@@ -26,6 +26,7 @@
 import org.apache.abdera.model.Content;
 import org.apache.abdera.model.Div;
 import org.apache.abdera.model.Element;
+import org.apache.abdera.model.ElementWrapper;
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.axiom.attachments.utils.DataHandlerUtils;
@@ -121,7 +122,8 @@
   
   @SuppressWarnings("unchecked")
   public <T extends Element> T getValueElement() {
-    return (T)this.getFirstElement();
+    FOMFactory factory = (FOMFactory) getFactory();
+    return (T)factory.getElementWrapper((Element)this.getFirstElement());
   }
 
   public <T extends Element> void setValueElement(T value) {
@@ -135,7 +137,8 @@
           init(Content.Type.XML);
         }
       }
-      this.setFirstChild((OMElement)value);
+      OMElement el = (OMElement) (value instanceof ElementWrapper ? ((ElementWrapper)value).getInternal()
: value); 
+      this.setFirstChild(el);
     } else {
       _removeAllChildren();
     }



Mime
View raw message