abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r440886 - in /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax: FOMExtensibleElement.java FOMFactory.java
Date Wed, 06 Sep 2006 21:49:04 GMT
Author: jmsnell
Date: Wed Sep  6 14:49:03 2006
New Revision: 440886

URL: http://svn.apache.org/viewvc?view=rev&rev=440886
Log:
Make Factory.newElement() return an instance of FOMExtensibleElement to make 
extension support easier.. e.g., we can now do:

  ExtensibleElement element = (ExtensibleElement)factory.newElement(...)

Before, factory.newElement(...) would return an instance of Element that did not
implement the ExtensibleElement interface, making it harder to add extension elements
dynamically

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

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java?view=diff&rev=440886&r1=440885&r2=440886
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
Wed Sep  6 14:49:03 2006
@@ -32,9 +32,11 @@
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
 
-public abstract class FOMExtensibleElement 
+public class FOMExtensibleElement 
   extends FOMElement 
   implements ExtensibleElement {
+
+  private static final long serialVersionUID = -1652430686161947531L;
 
   public FOMExtensibleElement(QName qname) {
     super(qname);

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java?view=diff&rev=440886&r1=440885&r2=440886
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
Wed Sep  6 14:49:03 2006
@@ -402,7 +402,7 @@
   public Element newElement(
     QName qname, 
     Base parent) {
-      return new FOMElement(qname, (OMContainer)parent,this);
+      return new FOMExtensibleElement(qname, (OMContainer)parent,this);
   }
   
   public Element newExtensionElement(QName qname) {
@@ -450,9 +450,9 @@
     }
     if (element == null) {
       if (parserWrapper == null) {
-        element = new FOMElement(qname, parent, this);
+        element = new FOMExtensibleElement(qname, parent, this);
       } else {
-        element = new FOMElement(qname, parent, this, parserWrapper);
+        element = new FOMExtensibleElement(qname, parent, this, parserWrapper);
       }
     }
     return element;
@@ -637,7 +637,7 @@
     QName qname,
     OMContainer parent,
     OMXMLParserWrapper parserWrapper) {
-      return new FOMElement(qname,parent,this,parserWrapper);
+      return new FOMExtensibleElement(qname,parent,this,parserWrapper);
   }
   
   @SuppressWarnings("unchecked")
@@ -773,9 +773,9 @@
     } else if (COLLECTION.equals(qname)) {
       element = (OMElement) newCollection(qname, parent, builder);
     } else if (NAME.equals(qname)) {
-      element = (OMElement) newElement(qname, parent, builder);
+      element = (OMElement) new FOMElement(qname,parent,this,builder);
     } else if (EMAIL.equals(qname)) {
-      element = (OMElement) newElement(qname, parent, builder);
+      element = (OMElement) new FOMElement(qname,parent,this,builder);
     } else if (URI.equals(qname)) {
       element = (OMElement) newURIElement(qname, parent, builder);
     } else if (CONTROL.equals(qname)) {



Mime
View raw message