ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1706491 - in /webservices/axiom/trunk: aspects/fom-aspects/src/main/java/org/apache/axiom/fom/ implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/
Date Fri, 02 Oct 2015 21:31:27 GMT
Author: veithen
Date: Fri Oct  2 21:31:26 2015
New Revision: 1706491

URL: http://svn.apache.org/viewvc?rev=1706491&view=rev
Log:
Transform FOMCollection, FOMControl and FOMDateTime into mixins.

Added:
    webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaCollectionMixin.aj
      - copied, changed from r1706479, webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
    webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaControlMixin.aj
      - copied, changed from r1706461, webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMControl.java
    webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaDateTimeMixin.aj
      - copied, changed from r1706461, webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java
Modified:
    webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElement.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMControl.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java

Copied: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaCollectionMixin.aj
(from r1706479, webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaCollectionMixin.aj?p2=webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaCollectionMixin.aj&p1=webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java&r1=1706479&r2=1706491&rev=1706491&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
(original)
+++ webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaCollectionMixin.aj
Fri Oct  2 21:31:26 2015
@@ -15,7 +15,7 @@
  * copyright in this work, please see the NOTICE file in the top level
  * directory of this distribution.
  */
-package org.apache.abdera.parser.stax;
+package org.apache.axiom.fom;
 
 import static org.apache.abdera.util.Constants.ACCEPT;
 import static org.apache.abdera.util.Constants.CATEGORIES;
@@ -38,48 +38,47 @@ import org.apache.abdera.model.Text;
 import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.axiom.fom.AbderaCollection;
 import org.apache.axiom.fom.AbderaElement;
-import org.apache.axiom.om.OMElement;
 
 @SuppressWarnings("deprecation")
-public class FOMCollection extends FOMExtensibleElement implements AbderaCollection {
+public aspect AbderaCollectionMixin {
 
     private static final String[] ENTRY = {"application/atom+xml;type=\"entry\""};
     private static final String[] EMPTY = new String[0];
 
-    public String getTitle() {
+    public final String AbderaCollection.getTitle() {
         Text title = this.getFirstChild(TITLE);
         return (title != null) ? title.getValue() : null;
     }
 
-    private Text setTitle(String title, Text.Type type) {
+    private Text AbderaCollection.setTitle(String title, Text.Type type) {
         Text text = getFactory().newText(PREFIXED_TITLE, type);
         text.setValue(title);
         this._setChild(PREFIXED_TITLE, text);
         return text;
     }
 
-    public Text setTitle(String title) {
+    public final Text AbderaCollection.setTitle(String title) {
         return setTitle(title, Text.Type.TEXT);
     }
 
-    public Text setTitleAsHtml(String title) {
+    public final Text AbderaCollection.setTitleAsHtml(String title) {
         return setTitle(title, Text.Type.HTML);
     }
 
-    public Text setTitleAsXHtml(String title) {
+    public final Text AbderaCollection.setTitleAsXHtml(String title) {
         return setTitle(title, Text.Type.XHTML);
     }
 
-    public Text getTitleElement() {
+    public final Text AbderaCollection.getTitleElement() {
         return getFirstChild(TITLE);
     }
 
-    public Collection setHref(String href) {
+    public final Collection AbderaCollection.setHref(String href) {
         internalSetHref(href);
         return this;
     }
 
-    public String[] getAccept() {
+    public final String[] AbderaCollection.getAccept() {
         List<String> accept = new ArrayList<String>();
         Iterator<AbderaElement> i = _getChildrenWithName(ACCEPT);
         if (i == null || !i.hasNext())
@@ -99,11 +98,11 @@ public class FOMCollection extends FOMEx
         }
     }
 
-    public Collection setAccept(String mediaRange) {
+    public final Collection AbderaCollection.setAccept(String mediaRange) {
         return setAccept(new String[] {mediaRange});
     }
 
-    public Collection setAccept(String... mediaRanges) {
+    public final Collection AbderaCollection.setAccept(String... mediaRanges) {
         if (mediaRanges != null && mediaRanges.length > 0) {
             _removeChildren(ACCEPT, true);
             _removeChildren(PRE_RFC_ACCEPT, true);
@@ -130,11 +129,11 @@ public class FOMCollection extends FOMEx
         return this;
     }
 
-    public Collection addAccepts(String mediaRange) {
+    public final Collection AbderaCollection.addAccepts(String mediaRange) {
         return addAccepts(new String[] {mediaRange});
     }
 
-    public Collection addAccepts(String... mediaRanges) {
+    public final Collection AbderaCollection.addAccepts(String... mediaRanges) {
         if (mediaRanges != null) {
             for (String type : mediaRanges) {
                 if (!accepts(type)) {
@@ -148,27 +147,27 @@ public class FOMCollection extends FOMEx
         return this;
     }
 
-    public Collection addAcceptsEntry() {
+    public final Collection AbderaCollection.addAcceptsEntry() {
         return addAccepts("application/atom+xml;type=entry");
     }
 
-    public Collection setAcceptsEntry() {
+    public final Collection AbderaCollection.setAcceptsEntry() {
         return setAccept("application/atom+xml;type=entry");
     }
 
-    public Collection setAcceptsNothing() {
+    public final Collection AbderaCollection.setAcceptsNothing() {
         return setAccept("");
     }
 
-    public boolean acceptsEntry() {
+    public final boolean AbderaCollection.acceptsEntry() {
         return accepts("application/atom+xml;type=entry");
     }
 
-    public boolean acceptsNothing() {
+    public final boolean AbderaCollection.acceptsNothing() {
         return accepts("");
     }
 
-    public boolean accepts(String mediaType) {
+    public final boolean AbderaCollection.accepts(String mediaType) {
         String[] accept = getAccept();
         if (accept.length == 0)
             accept = ENTRY;
@@ -179,27 +178,27 @@ public class FOMCollection extends FOMEx
         return false;
     }
 
-    public boolean accepts(MimeType mediaType) {
+    public final boolean AbderaCollection.accepts(MimeType mediaType) {
         return accepts(mediaType.toString());
     }
 
-    public Categories addCategories() {
+    public final Categories AbderaCollection.addCategories() {
         return getFactory().newCategories(this);
     }
 
-    public Collection addCategories(Categories categories) {
-        addChild((OMElement)categories);
+    public final Collection AbderaCollection.addCategories(Categories categories) {
+        coreAppendChild((AbderaCategories)categories, false);
         return this;
     }
 
-    public Categories addCategories(String href) {
+    public final Categories AbderaCollection.addCategories(String href) {
         Categories cats = getFactory().newCategories();
         cats.setHref(href);
         addCategories(cats);
         return cats;
     }
 
-    public Categories addCategories(List<Category> categories, boolean fixed, String
scheme) {
+    public final Categories AbderaCollection.addCategories(List<Category> categories,
boolean fixed, String scheme) {
         Categories cats = getFactory().newCategories();
         cats.setFixed(fixed);
         if (scheme != null)
@@ -213,7 +212,7 @@ public class FOMCollection extends FOMEx
         return cats;
     }
 
-    public List<Categories> getCategories() {
+    public final List<Categories> AbderaCollection.getCategories() {
         List<Categories> list = _getChildrenAsSet(CATEGORIES);
         if (list == null || list.size() == 0)
             list = _getChildrenAsSet(PRE_RFC_CATEGORIES);

Copied: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaControlMixin.aj
(from r1706461, webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMControl.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaControlMixin.aj?p2=webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaControlMixin.aj&p1=webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMControl.java&r1=1706461&r2=1706491&rev=1706491&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMControl.java
(original)
+++ webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaControlMixin.aj
Fri Oct  2 21:31:26 2015
@@ -15,7 +15,7 @@
  * copyright in this work, please see the NOTICE file in the top level
  * directory of this distribution.
  */
-package org.apache.abdera.parser.stax;
+package org.apache.axiom.fom;
 
 import static org.apache.abdera.util.Constants.DRAFT;
 import static org.apache.abdera.util.Constants.NO;
@@ -26,21 +26,21 @@ import org.apache.abdera.model.Control;
 import org.apache.axiom.fom.AbderaControl;
 
 @SuppressWarnings("deprecation")
-public class FOMControl extends FOMExtensibleElement implements AbderaControl {
-    public boolean isDraft() {
+public aspect AbderaControlMixin {
+    public final boolean AbderaControl.isDraft() {
         String value = _getElementValue(DRAFT);
         if (value == null)
             value = _getElementValue(PRE_RFC_DRAFT);
         return (value != null && YES.equalsIgnoreCase(value));
     }
 
-    public Control setDraft(boolean draft) {
+    public final Control AbderaControl.setDraft(boolean draft) {
         _removeChildren(PRE_RFC_DRAFT, true);
         _setElementValue(DRAFT, (draft) ? YES : NO);
         return this;
     }
 
-    public Control unsetDraft() {
+    public final Control AbderaControl.unsetDraft() {
         _removeChildren(PRE_RFC_DRAFT, true);
         _removeChildren(DRAFT, true);
         return this;

Copied: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaDateTimeMixin.aj
(from r1706461, webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaDateTimeMixin.aj?p2=webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaDateTimeMixin.aj&p1=webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java&r1=1706461&r2=1706491&rev=1706491&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java
(original)
+++ webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaDateTimeMixin.aj
Fri Oct  2 21:31:26 2015
@@ -15,7 +15,7 @@
  * copyright in this work, please see the NOTICE file in the top level
  * directory of this distribution.
  */
-package org.apache.abdera.parser.stax;
+package org.apache.axiom.fom;
 
 import java.util.Calendar;
 import java.util.Date;
@@ -24,62 +24,62 @@ import org.apache.abdera.model.AtomDate;
 import org.apache.abdera.model.DateTime;
 import org.apache.axiom.fom.AbderaDateTime;
 
-public class FOMDateTime extends FOMElement implements AbderaDateTime {
-    private AtomDate value;
+public aspect AbderaDateTimeMixin {
+    private AtomDate AbderaDateTime.value;
 
-    public AtomDate getValue() {
+    public final AtomDate AbderaDateTime.getValue() {
         if (value == null) {
             value = AtomDate.valueOf(getText());
         }
         return value;
     }
 
-    public DateTime setValue(AtomDate dateTime) {
+    public final DateTime AbderaDateTime.setValue(AtomDate dateTime) {
         value = null;
         setText(dateTime == null ? null : dateTime.getValue());
         return this;
     }
 
-    public DateTime setDate(Date date) {
+    public final DateTime AbderaDateTime.setDate(Date date) {
         value = null;
         setText(date == null ? null : AtomDate.valueOf(date).getValue());
         return this;
     }
 
-    public DateTime setCalendar(Calendar date) {
+    public final DateTime AbderaDateTime.setCalendar(Calendar date) {
         value = null;
         setText(date == null ? null : AtomDate.valueOf(date).getValue());
         return this;
     }
 
-    public DateTime setTime(long date) {
+    public final DateTime AbderaDateTime.setTime(long date) {
         value = null;
         setText(AtomDate.valueOf(date).getValue());
         return this;
     }
 
-    public DateTime setString(String date) {
+    public final DateTime AbderaDateTime.setString(String date) {
         value = null;
         setText(date == null ? null : AtomDate.valueOf(date).getValue());
         return this;
     }
 
-    public Date getDate() {
+    public final Date AbderaDateTime.getDate() {
         AtomDate ad = getValue();
         return (ad != null) ? ad.getDate() : null;
     }
 
-    public Calendar getCalendar() {
+    public final Calendar AbderaDateTime.getCalendar() {
         AtomDate ad = getValue();
         return (ad != null) ? ad.getCalendar() : null;
     }
 
-    public long getTime() {
+    public final long AbderaDateTime.getTime() {
         AtomDate ad = getValue();
         return (ad != null) ? ad.getTime() : null;
     }
 
-    public String getString() {
+    public final String AbderaDateTime.getString() {
         AtomDate ad = getValue();
         return (ad != null) ? ad.getValue() : null;
     }

Modified: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElement.java?rev=1706491&r1=1706490&r2=1706491&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElement.java
(original)
+++ webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElement.java
Fri Oct  2 21:31:26 2015
@@ -18,6 +18,7 @@
  */
 package org.apache.axiom.fom;
 
+import java.util.Iterator;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -27,4 +28,9 @@ import org.apache.axiom.core.CoreNSAware
 
 public interface AbderaElement extends Element, AbderaChildNode, CoreNSAwareElement {
     <E extends Element> List<E> _getChildrenAsSet(QName qname);
+    void _setChild(QName qname, Element element);
+    Iterator<AbderaElement> _getChildrenWithName(QName qname);
+    void _removeChildren(QName qname, boolean many);
+    String _getElementValue(QName qname);
+    void _setElementValue(QName qname, String value);
 }

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java?rev=1706491&r1=1706490&r2=1706491&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
Fri Oct  2 21:31:26 2015
@@ -17,207 +17,8 @@
  */
 package org.apache.abdera.parser.stax;
 
-import static org.apache.abdera.util.Constants.ACCEPT;
-import static org.apache.abdera.util.Constants.CATEGORIES;
-import static org.apache.abdera.util.Constants.PREFIXED_TITLE;
-import static org.apache.abdera.util.Constants.PRE_RFC_ACCEPT;
-import static org.apache.abdera.util.Constants.PRE_RFC_CATEGORIES;
-import static org.apache.abdera.util.Constants.TITLE;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.activation.MimeType;
-
-import org.apache.abdera.model.Categories;
-import org.apache.abdera.model.Category;
-import org.apache.abdera.model.Collection;
-import org.apache.abdera.model.Element;
-import org.apache.abdera.model.Text;
-import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.axiom.fom.AbderaCollection;
-import org.apache.axiom.fom.AbderaElement;
-import org.apache.axiom.om.OMElement;
 
-@SuppressWarnings("deprecation")
 public class FOMCollection extends FOMExtensibleElement implements AbderaCollection {
 
-    private static final String[] ENTRY = {"application/atom+xml;type=\"entry\""};
-    private static final String[] EMPTY = new String[0];
-
-    public String getTitle() {
-        Text title = this.getFirstChild(TITLE);
-        return (title != null) ? title.getValue() : null;
-    }
-
-    private Text setTitle(String title, Text.Type type) {
-        Text text = getFactory().newText(PREFIXED_TITLE, type);
-        text.setValue(title);
-        this._setChild(PREFIXED_TITLE, text);
-        return text;
-    }
-
-    public Text setTitle(String title) {
-        return setTitle(title, Text.Type.TEXT);
-    }
-
-    public Text setTitleAsHtml(String title) {
-        return setTitle(title, Text.Type.HTML);
-    }
-
-    public Text setTitleAsXHtml(String title) {
-        return setTitle(title, Text.Type.XHTML);
-    }
-
-    public Text getTitleElement() {
-        return getFirstChild(TITLE);
-    }
-
-    public Collection setHref(String href) {
-        internalSetHref(href);
-        return this;
-    }
-
-    public String[] getAccept() {
-        List<String> accept = new ArrayList<String>();
-        Iterator<AbderaElement> i = _getChildrenWithName(ACCEPT);
-        if (i == null || !i.hasNext())
-            i = _getChildrenWithName(PRE_RFC_ACCEPT);
-        while (i.hasNext()) {
-            Element e = i.next();
-            String t = e.getText();
-            if (t != null) {
-                accept.add(t.trim());
-            }
-        }
-        if (accept.size() > 0) {
-            String[] list = accept.toArray(new String[accept.size()]);
-            return MimeTypeHelper.condense(list);
-        } else {
-            return EMPTY;
-        }
-    }
-
-    public Collection setAccept(String mediaRange) {
-        return setAccept(new String[] {mediaRange});
-    }
-
-    public Collection setAccept(String... mediaRanges) {
-        if (mediaRanges != null && mediaRanges.length > 0) {
-            _removeChildren(ACCEPT, true);
-            _removeChildren(PRE_RFC_ACCEPT, true);
-            if (mediaRanges.length == 1 && mediaRanges[0].equals("")) {
-                addExtension(ACCEPT);
-            } else {
-                mediaRanges = MimeTypeHelper.condense(mediaRanges);
-                for (String type : mediaRanges) {
-                    if (type.equalsIgnoreCase("entry")) {
-                        addSimpleExtension(ACCEPT, "application/atom+xml;type=entry");
-                    } else {
-                        try {
-                            addSimpleExtension(ACCEPT, new MimeType(type).toString());
-                        } catch (javax.activation.MimeTypeParseException e) {
-                            throw new org.apache.abdera.util.MimeTypeParseException(e);
-                        }
-                    }
-                }
-            }
-        } else {
-            _removeChildren(ACCEPT, true);
-            _removeChildren(PRE_RFC_ACCEPT, true);
-        }
-        return this;
-    }
-
-    public Collection addAccepts(String mediaRange) {
-        return addAccepts(new String[] {mediaRange});
-    }
-
-    public Collection addAccepts(String... mediaRanges) {
-        if (mediaRanges != null) {
-            for (String type : mediaRanges) {
-                if (!accepts(type)) {
-                    try {
-                        addSimpleExtension(ACCEPT, new MimeType(type).toString());
-                    } catch (Exception e) {
-                    }
-                }
-            }
-        }
-        return this;
-    }
-
-    public Collection addAcceptsEntry() {
-        return addAccepts("application/atom+xml;type=entry");
-    }
-
-    public Collection setAcceptsEntry() {
-        return setAccept("application/atom+xml;type=entry");
-    }
-
-    public Collection setAcceptsNothing() {
-        return setAccept("");
-    }
-
-    public boolean acceptsEntry() {
-        return accepts("application/atom+xml;type=entry");
-    }
-
-    public boolean acceptsNothing() {
-        return accepts("");
-    }
-
-    public boolean accepts(String mediaType) {
-        String[] accept = getAccept();
-        if (accept.length == 0)
-            accept = ENTRY;
-        for (String a : accept) {
-            if (MimeTypeHelper.isMatch(a, mediaType))
-                return true;
-        }
-        return false;
-    }
-
-    public boolean accepts(MimeType mediaType) {
-        return accepts(mediaType.toString());
-    }
-
-    public Categories addCategories() {
-        return getFactory().newCategories(this);
-    }
-
-    public Collection addCategories(Categories categories) {
-        addChild((OMElement)categories);
-        return this;
-    }
-
-    public Categories addCategories(String href) {
-        Categories cats = getFactory().newCategories();
-        cats.setHref(href);
-        addCategories(cats);
-        return cats;
-    }
-
-    public Categories addCategories(List<Category> categories, boolean fixed, String
scheme) {
-        Categories cats = getFactory().newCategories();
-        cats.setFixed(fixed);
-        if (scheme != null)
-            cats.setScheme(scheme);
-        if (categories != null) {
-            for (Category category : categories) {
-                cats.addCategory(category);
-            }
-        }
-        addCategories(cats);
-        return cats;
-    }
-
-    public List<Categories> getCategories() {
-        List<Categories> list = _getChildrenAsSet(CATEGORIES);
-        if (list == null || list.size() == 0)
-            list = _getChildrenAsSet(PRE_RFC_CATEGORIES);
-        return list;
-    }
-
 }

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMControl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMControl.java?rev=1706491&r1=1706490&r2=1706491&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMControl.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMControl.java
Fri Oct  2 21:31:26 2015
@@ -17,33 +17,8 @@
  */
 package org.apache.abdera.parser.stax;
 
-import static org.apache.abdera.util.Constants.DRAFT;
-import static org.apache.abdera.util.Constants.NO;
-import static org.apache.abdera.util.Constants.PRE_RFC_DRAFT;
-import static org.apache.abdera.util.Constants.YES;
-
-import org.apache.abdera.model.Control;
 import org.apache.axiom.fom.AbderaControl;
 
-@SuppressWarnings("deprecation")
 public class FOMControl extends FOMExtensibleElement implements AbderaControl {
-    public boolean isDraft() {
-        String value = _getElementValue(DRAFT);
-        if (value == null)
-            value = _getElementValue(PRE_RFC_DRAFT);
-        return (value != null && YES.equalsIgnoreCase(value));
-    }
-
-    public Control setDraft(boolean draft) {
-        _removeChildren(PRE_RFC_DRAFT, true);
-        _setElementValue(DRAFT, (draft) ? YES : NO);
-        return this;
-    }
-
-    public Control unsetDraft() {
-        _removeChildren(PRE_RFC_DRAFT, true);
-        _removeChildren(DRAFT, true);
-        return this;
-    }
 
 }

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java?rev=1706491&r1=1706490&r2=1706491&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java
Fri Oct  2 21:31:26 2015
@@ -17,71 +17,8 @@
  */
 package org.apache.abdera.parser.stax;
 
-import java.util.Calendar;
-import java.util.Date;
-
-import org.apache.abdera.model.AtomDate;
-import org.apache.abdera.model.DateTime;
 import org.apache.axiom.fom.AbderaDateTime;
 
 public class FOMDateTime extends FOMElement implements AbderaDateTime {
-    private AtomDate value;
-
-    public AtomDate getValue() {
-        if (value == null) {
-            value = AtomDate.valueOf(getText());
-        }
-        return value;
-    }
-
-    public DateTime setValue(AtomDate dateTime) {
-        value = null;
-        setText(dateTime == null ? null : dateTime.getValue());
-        return this;
-    }
-
-    public DateTime setDate(Date date) {
-        value = null;
-        setText(date == null ? null : AtomDate.valueOf(date).getValue());
-        return this;
-    }
-
-    public DateTime setCalendar(Calendar date) {
-        value = null;
-        setText(date == null ? null : AtomDate.valueOf(date).getValue());
-        return this;
-    }
-
-    public DateTime setTime(long date) {
-        value = null;
-        setText(AtomDate.valueOf(date).getValue());
-        return this;
-    }
-
-    public DateTime setString(String date) {
-        value = null;
-        setText(date == null ? null : AtomDate.valueOf(date).getValue());
-        return this;
-    }
-
-    public Date getDate() {
-        AtomDate ad = getValue();
-        return (ad != null) ? ad.getDate() : null;
-    }
-
-    public Calendar getCalendar() {
-        AtomDate ad = getValue();
-        return (ad != null) ? ad.getCalendar() : null;
-    }
-
-    public long getTime() {
-        AtomDate ad = getValue();
-        return (ad != null) ? ad.getTime() : null;
-    }
-
-    public String getString() {
-        AtomDate ad = getValue();
-        return (ad != null) ? ad.getValue() : null;
-    }
 
 }

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?rev=1706491&r1=1706490&r2=1706491&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
Fri Oct  2 21:31:26 2015
@@ -223,7 +223,7 @@ public class FOMElement extends FOMChild
         return (T)this;
     }
 
-    protected final Iterator<AbderaElement> _getChildrenWithName(QName qname) {
+    public final Iterator<AbderaElement> _getChildrenWithName(QName qname) {
         return coreGetElements(Axis.CHILDREN, AbderaElement.class, ElementMatcher.BY_QNAME,
                 qname.getNamespaceURI(), qname.getLocalPart(), FOMExceptionTranslator.INSTANCE,
                 Policies.DETACH_POLICY);
@@ -234,7 +234,7 @@ public class FOMElement extends FOMChild
         return new FOMList(new FOMElementIteratorWrapper(factory, _getChildrenWithName(qname)));
     }
 
-    protected void _setChild(QName qname, Element element) {
+    public void _setChild(QName qname, Element element) {
         AbderaElement e = null;
         CoreChildNode child = coreGetFirstChild();
         while (child != null) {
@@ -328,7 +328,7 @@ public class FOMElement extends FOMChild
         return (T)this;
     }
 
-    protected void _setElementValue(QName qname, String value) {
+    public void _setElementValue(QName qname, String value) {
         OMElement element = this.getFirstChildWithName(qname);
         if (element != null && value != null) {
             element.setText(value);
@@ -344,7 +344,7 @@ public class FOMElement extends FOMChild
         }
     }
 
-    protected String _getElementValue(QName qname) {
+    public String _getElementValue(QName qname) {
         String value = null;
         OMElement element = this.getFirstChildWithName(qname);
         if (element != null)
@@ -442,7 +442,7 @@ public class FOMElement extends FOMChild
         return (T)this;
     }
 
-    protected void _removeChildren(QName qname, boolean many) {
+    public void _removeChildren(QName qname, boolean many) {
         CoreChildNode child = coreGetFirstChild();
         while (child != null) {
             if (child instanceof CoreNSAwareElement) {



Mime
View raw message