abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1677470 - in /abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax: FOMCDATASection.java FOMCharacterData.java FOMContent.java FOMFactory.java FOMTextValue.java
Date Sun, 03 May 2015 18:18:37 GMT
Author: veithen
Date: Sun May  3 18:18:36 2015
New Revision: 1677470

URL: http://svn.apache.org/r1677470
Log:
Adapt to recent changes in Axiom.

Added:
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCDATASection.java
      - copied, changed from r1677458, abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCharacterData.java
      - copied, changed from r1677458, abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
Removed:
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
Modified:
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java

Copied: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCDATASection.java
(from r1677458, abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java)
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCDATASection.java?p2=abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCDATASection.java&p1=abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java&r1=1677458&r2=1677470&rev=1677470&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCDATASection.java
Sun May  3 18:18:36 2015
@@ -21,63 +21,19 @@ import java.io.IOException;
 import java.io.InputStream;
 
 import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Base;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.TextValue;
-import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.impl.llom.OMTextImpl;
+import org.apache.axiom.om.impl.llom.CDATASectionImpl;
 
 @SuppressWarnings("unchecked")
-public class FOMTextValue extends OMTextImpl implements TextValue {
+public class FOMCDATASection extends CDATASectionImpl implements TextValue {
 
-    public FOMTextValue(OMContainer parent, Object dataHandler,
-            boolean optimize, OMFactory factory, boolean fromBuilder) {
-        super(parent, dataHandler, optimize, factory, fromBuilder);
-    }
-
-    public FOMTextValue(Object dataHandler, OMFactory factory) {
-        super(dataHandler, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, char[] charArray, int nodeType, OMFactory factory)
{
-        super(parent, charArray, nodeType, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, QName text, int nodeType, OMFactory factory)
{
-        super(parent, text, nodeType, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, QName text, OMFactory factory) {
-        super(parent, text, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, String text, int nodeType,
-            OMFactory factory, boolean fromBuilder) {
-        super(parent, text, nodeType, factory, fromBuilder);
-    }
-
-    public FOMTextValue(OMContainer parent, String text, OMFactory factory) {
-        super(parent, text, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, String s, String mimeType, boolean optimize,
OMFactory factory) {
-        super(parent, s, mimeType, optimize, factory);
-    }
-
-    public FOMTextValue(String text, int nodeType, OMFactory factory) {
-        super(text, nodeType, factory);
-    }
-
-    public FOMTextValue(String text, OMFactory factory) {
-        super(text, factory);
-    }
-
-    public FOMTextValue(String s, String mimeType, boolean optimize, OMFactory factory) {
-        super(s, mimeType, optimize, factory);
+    public FOMCDATASection(OMFactory factory) {
+        super(factory);
     }
 
     public DataHandler getDataHandler() {

Copied: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCharacterData.java
(from r1677458, abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java)
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCharacterData.java?p2=abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCharacterData.java&p1=abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java&r1=1677458&r2=1677470&rev=1677470&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCharacterData.java
Sun May  3 18:18:36 2015
@@ -21,63 +21,19 @@ import java.io.IOException;
 import java.io.InputStream;
 
 import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Base;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.TextValue;
-import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.impl.llom.OMTextImpl;
+import org.apache.axiom.om.impl.llom.CharacterDataImpl;
 
 @SuppressWarnings("unchecked")
-public class FOMTextValue extends OMTextImpl implements TextValue {
+public class FOMCharacterData extends CharacterDataImpl implements TextValue {
 
-    public FOMTextValue(OMContainer parent, Object dataHandler,
-            boolean optimize, OMFactory factory, boolean fromBuilder) {
-        super(parent, dataHandler, optimize, factory, fromBuilder);
-    }
-
-    public FOMTextValue(Object dataHandler, OMFactory factory) {
-        super(dataHandler, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, char[] charArray, int nodeType, OMFactory factory)
{
-        super(parent, charArray, nodeType, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, QName text, int nodeType, OMFactory factory)
{
-        super(parent, text, nodeType, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, QName text, OMFactory factory) {
-        super(parent, text, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, String text, int nodeType,
-            OMFactory factory, boolean fromBuilder) {
-        super(parent, text, nodeType, factory, fromBuilder);
-    }
-
-    public FOMTextValue(OMContainer parent, String text, OMFactory factory) {
-        super(parent, text, factory);
-    }
-
-    public FOMTextValue(OMContainer parent, String s, String mimeType, boolean optimize,
OMFactory factory) {
-        super(parent, s, mimeType, optimize, factory);
-    }
-
-    public FOMTextValue(String text, int nodeType, OMFactory factory) {
-        super(text, nodeType, factory);
-    }
-
-    public FOMTextValue(String text, OMFactory factory) {
-        super(text, factory);
-    }
-
-    public FOMTextValue(String s, String mimeType, boolean optimize, OMFactory factory) {
-        super(s, mimeType, optimize, factory);
+    public FOMCharacterData(OMFactory factory) {
+        super(factory);
     }
 
     public DataHandler getDataHandler() {

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?rev=1677470&r1=1677469&r2=1677470&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java Sun
May  3 18:18:36 2015
@@ -29,7 +29,7 @@ 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.axiom.attachments.utils.DataHandlerUtils;
+import org.apache.axiom.attachments.ByteArrayDataSource;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -37,6 +37,7 @@ import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.util.base64.Base64Utils;
 
 @SuppressWarnings("unchecked")
 public class FOMContent extends FOMExtensibleElement implements Content {
@@ -179,9 +180,9 @@ public class FOMContent extends FOMExten
         }
         DataHandler dh = null;
         if (src == null) {
-            dh =
-                (DataHandler)DataHandlerUtils
-                    .getDataHandlerFromText(getText(), (type != null) ? type.toString() :
null);
+            dh = new DataHandler(new ByteArrayDataSource(
+                    Base64Utils.decode(getText()),
+                    (type != null) ? type.toString() : null));
         } else {
             dh = new DataHandler(new URLDataSource(src));
         }

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java?rev=1677470&r1=1677469&r2=1677470&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java Sun
May  3 18:18:36 2015
@@ -54,6 +54,8 @@ import org.apache.abdera.parser.stax.uti
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.abdera.util.Version;
+import org.apache.axiom.core.CoreCDATASection;
+import org.apache.axiom.core.CoreCharacterData;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMComment;
 import org.apache.axiom.om.OMContainer;
@@ -62,7 +64,6 @@ import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMProcessingInstruction;
-import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory;
 
@@ -634,63 +635,22 @@ public class FOMFactory extends OMLinked
     }
 
     @Override
-    public OMText createOMText(Object arg0, boolean arg1) {
-        return new FOMTextValue(null, arg0, arg1, this, false);
-    }
-
-    @Override
-    public OMText createOMText(OMContainer arg0, char[] arg1, int arg2) {
-        return new FOMTextValue(arg0, arg1, arg2, this);
-    }
-
-    @Override
-    public OMText createOMText(OMContainer arg0, QName arg1, int arg2) {
-        return new FOMTextValue(arg0, arg1, arg2, this);
-    }
-
-    @Override
-    public OMText createOMText(OMContainer arg0, QName arg1) {
-        return new FOMTextValue(arg0, arg1, this);
-    }
-
-    @Override
-    public OMText createOMText(OMContainer arg0, String arg1, int arg2) {
-        return new FOMTextValue(arg0, arg1, arg2, this, false);
-    }
-
-    @Override
-    public OMText createOMText(OMContainer arg0, String arg1, String arg2, boolean arg3)
{
-        return new FOMTextValue(arg0, arg1, arg2, arg3, this);
-    }
-
-    @Override
-    public OMText createOMText(OMContainer arg0, String arg1) {
-        return new FOMTextValue(arg0, arg1, this);
-    }
-
-    @Override
-    public OMText createOMText(String arg0, int arg1) {
-        return new FOMTextValue(arg0, arg1, this);
-    }
-
-    @Override
-    public OMText createOMText(String arg0, String arg1, boolean arg2) {
-        return new FOMTextValue(arg0, arg1, arg2, this);
+    public OMComment createOMComment(OMContainer arg0, String arg1) {
+        return new FOMComment(arg0, arg1, this, false);
     }
 
     @Override
-    public OMText createOMText(String arg0) {
-        return new FOMTextValue(arg0, this);
+    public OMProcessingInstruction createOMProcessingInstruction(OMContainer arg0, String
arg1, String arg2) {
+        return new FOMProcessingInstruction(arg0, arg1, arg2, this, false);
     }
 
     @Override
-    public OMComment createOMComment(OMContainer arg0, String arg1) {
-        return new FOMComment(arg0, arg1, this, false);
+    public CoreCharacterData createCharacterData() {
+        return new FOMCharacterData(this);
     }
 
     @Override
-    public OMProcessingInstruction createOMProcessingInstruction(OMContainer arg0, String
arg1, String arg2) {
-        return new FOMProcessingInstruction(arg0, arg1, arg2, this, false);
+    public CoreCDATASection createCDATASection() {
+        return new FOMCDATASection(this);
     }
-
 }



Mime
View raw message