ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1697825 - in /webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax: FOMContent.java FOMFactory.java FOMText.java
Date Wed, 26 Aug 2015 06:53:03 GMT
Author: veithen
Date: Wed Aug 26 06:53:03 2015
New Revision: 1697825

URL: http://svn.apache.org/r1697825
Log:
Some code simplifications.

Modified:
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMText.java

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?rev=1697825&r1=1697824&r2=1697825&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
Wed Aug 26 06:53:03 2015
@@ -53,9 +53,8 @@ public class FOMContent extends FOMExten
         setContentType(type);
     }
 
-    protected FOMContent(String localName, Type type, OMContainer parent, OMFactory factory,
OMXMLParserWrapper builder) {
+    protected FOMContent(String localName, OMContainer parent, OMFactory factory, OMXMLParserWrapper
builder) {
         super(localName, parent, factory, builder);
-        setContentType(type);
     }
 
     public final Type getContentType() {

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java?rev=1697825&r1=1697824&r2=1697825&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
Wed Aug 26 06:53:03 2015
@@ -508,10 +508,7 @@ public class FOMFactory extends OMLinked
         } else if (CATEGORY.equals(qname)) {
             element = new FOMCategory(qname.getLocalPart(), parent, this, builder);
         } else if (CONTENT.equals(qname)) {
-            Content.Type type = builder.getContentType();
-            if (type == null)
-                type = Content.Type.TEXT;
-            element = new FOMContent(qname.getLocalPart(), type, parent, this, builder);
+            element = new FOMContent(qname.getLocalPart(), parent, this, builder);
         } else if (CONTRIBUTOR.equals(qname)) {
             element = new FOMPerson(qname.getLocalPart(), parent, this, builder);
         } else if (GENERATOR.equals(qname)) {
@@ -527,27 +524,15 @@ public class FOMFactory extends OMLinked
         } else if (PUBLISHED.equals(qname)) {
             element = new FOMDateTime(qname.getLocalPart(), parent, this, builder);
         } else if (RIGHTS.equals(qname)) {
-            Text.Type type = builder.getTextType();
-            if (type == null)
-                type = Text.Type.TEXT;
-            element = new FOMText(type, qname.getLocalPart(), parent, this, builder);
+            element = new FOMText(qname.getLocalPart(), parent, this, builder);
         } else if (SOURCE.equals(qname)) {
             element = new FOMSource(qname.getLocalPart(), parent, this, builder);
         } else if (SUBTITLE.equals(qname)) {
-            Text.Type type = builder.getTextType();
-            if (type == null)
-                type = Text.Type.TEXT;
-            element = new FOMText(type, qname.getLocalPart(), parent, this, builder);
+            element = new FOMText(qname.getLocalPart(), parent, this, builder);
         } else if (SUMMARY.equals(qname)) {
-            Text.Type type = builder.getTextType();
-            if (type == null)
-                type = Text.Type.TEXT;
-            element = new FOMText(type, qname.getLocalPart(), parent, this, builder);
+            element = new FOMText(qname.getLocalPart(), parent, this, builder);
         } else if (TITLE.equals(qname)) {
-            Text.Type type = builder.getTextType();
-            if (type == null)
-                type = Text.Type.TEXT;
-            element = new FOMText(type, qname.getLocalPart(), parent, this, builder);
+            element = new FOMText(qname.getLocalPart(), parent, this, builder);
         } else if (UPDATED.equals(qname)) {
             element = new FOMDateTime(qname.getLocalPart(), parent, this, builder);
         } else if (WORKSPACE.equals(qname) || PRE_RFC_WORKSPACE.equals(qname)) {
@@ -571,6 +556,13 @@ public class FOMFactory extends OMLinked
         } else if (parent instanceof ExtensibleElement || parent instanceof Document) {
             element = new FOMExtensibleElement(qname.getLocalPart(), parent, this, builder);
         }
+        if (element instanceof FOMContent) {
+            Content.Type type = builder.getContentType();
+            ((FOMContent)element).setContentType(type == null ? Content.Type.TEXT : type);
+        } else if (element instanceof FOMText) {
+            Text.Type type = builder.getTextType();
+            ((FOMText)element).setTextType(type == null ? Text.Type.TEXT : type);
+        }
         return element;
     }
 

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMText.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMText.java?rev=1697825&r1=1697824&r2=1697825&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMText.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMText.java
Wed Aug 26 06:53:03 2015
@@ -46,10 +46,9 @@ public class FOMText extends FOMElement
         setTextType(type);
     }
 
-    protected FOMText(Type type, String localName, OMContainer parent, OMFactory factory,
OMXMLParserWrapper builder)
+    protected FOMText(String localName, OMContainer parent, OMFactory factory, OMXMLParserWrapper
builder)
         throws OMException {
         super(localName, parent, factory, builder);
-        setTextType(type);
     }
 
     public final Type getTextType() {



Mime
View raw message