ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1706568 - 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 Sat, 03 Oct 2015 12:52:41 GMT
Author: veithen
Date: Sat Oct  3 12:52:40 2015
New Revision: 1706568

URL: http://svn.apache.org/viewvc?rev=1706568&view=rev
Log:
Partially convert FOMEntry to mixins.

Added:
    webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaEntryMixin.aj
      - copied, changed from r1706552, webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
    webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/LinkUtil.java   (with props)
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/FOMElement.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMSource.java

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=1706568&r1=1706567&r2=1706568&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 Sat Oct  3 12:52:40 2015
@@ -24,6 +24,7 @@ import java.util.List;
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.model.Element;
+import org.apache.abdera.model.Text;
 import org.apache.axiom.core.CoreNSAwareElement;
 
 public interface AbderaElement extends Element, AbderaChildNode, CoreNSAwareElement {
@@ -35,4 +36,7 @@ public interface AbderaElement extends E
     String _getElementValue(QName qname);
     void _setElementValue(QName qname, String value);
     AbderaElement _getFirstChildWithName(QName qname);
+    <T extends Text> T getTextElement(QName qname);
+    <T extends Text> void setTextElement(QName qname, T text, boolean many);
+    String getText(QName qname);
 }

Copied: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaEntryMixin.aj (from r1706552, webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaEntryMixin.aj?p2=webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaEntryMixin.aj&p1=webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java&r1=1706552&r2=1706568&rev=1706568&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java (original)
+++ webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaEntryMixin.aj Sat Oct  3 12:52:40 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.APP_NS;
 import static org.apache.abdera.util.Constants.AUTHOR;
@@ -62,34 +62,34 @@ import org.apache.abdera.model.Link;
 import org.apache.abdera.model.Person;
 import org.apache.abdera.model.Source;
 import org.apache.abdera.model.Text;
-import org.apache.abdera.parser.stax.util.FOMHelper;
 import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.axiom.fom.AbderaEntry;
 import org.apache.axiom.fom.AbderaLink;
 import org.apache.axiom.fom.AbderaPerson;
+import org.apache.axiom.fom.LinkUtil;
 
 @SuppressWarnings( {"unchecked", "deprecation"})
-public class FOMEntry extends FOMExtensibleElement implements AbderaEntry {
-    public Person getAuthor() {
+public aspect AbderaEntryMixin {
+    public final Person AbderaEntry.getAuthor() {
         return (Person)_getFirstChildWithName(AUTHOR);
     }
 
-    public List<Person> getAuthors() {
+    public final List<Person> AbderaEntry.getAuthors() {
         return _getChildrenAsSet(AUTHOR);
     }
 
-    public Entry addAuthor(Person person) {
+    public final Entry AbderaEntry.addAuthor(Person person) {
         _addChild((AbderaPerson)person);
         return this;
     }
 
-    public Person addAuthor(String name) {
+    public final Person AbderaEntry.addAuthor(String name) {
         Person person = getFactory().newAuthor(this);
         person.setName(name);
         return person;
     }
 
-    public Person addAuthor(String name, String email, String uri) {
+    public final Person AbderaEntry.addAuthor(String name, String email, String uri) {
         Person person = getFactory().newAuthor(this);
         person.setName(name);
         person.setEmail(email);
@@ -97,16 +97,16 @@ public class FOMEntry extends FOMExtensi
         return person;
     }
 
-    public Entry addCategory(Category category) {
+    public final Entry AbderaEntry.addCategory(Category category) {
         internalAddCategory(category);
         return this;
     }
 
-    public Content getContentElement() {
+    public final Content AbderaEntry.getContentElement() {
         return (Content)_getFirstChildWithName(CONTENT);
     }
 
-    public Entry setContentElement(Content content) {
+    public final Entry AbderaEntry.setContentElement(Content content) {
         _setChild(CONTENT, content);
         return this;
     }
@@ -114,25 +114,25 @@ public class FOMEntry extends FOMExtensi
     /**
      * Sets the content for this entry as @type="text"
      */
-    public Content setContent(String value) {
+    public final Content AbderaEntry.setContent(String value) {
         Content content = getFactory().newContent();
         content.setValue(value);
         setContentElement(content);
         return content;
     }
 
-    public Content setContentAsHtml(String value) {
+    public final Content AbderaEntry.setContentAsHtml(String value) {
         return setContent(value, Content.Type.HTML);
     }
 
-    public Content setContentAsXhtml(String value) {
+    public final Content AbderaEntry.setContentAsXhtml(String value) {
         return setContent(value, Content.Type.XHTML);
     }
 
     /**
      * Sets the content for this entry
      */
-    public Content setContent(String value, Content.Type type) {
+    public final Content AbderaEntry.setContent(String value, Content.Type type) {
         Content content = getFactory().newContent(type);
         content.setValue(value);
         setContentElement(content);
@@ -142,7 +142,7 @@ public class FOMEntry extends FOMExtensi
     /**
      * Sets the content for this entry
      */
-    public Content setContent(Element value) {
+    public final Content AbderaEntry.setContent(Element value) {
         Content content = getFactory().newContent();
         content.setValueElement(value);
         setContentElement(content);
@@ -154,7 +154,7 @@ public class FOMEntry extends FOMExtensi
      * 
      * @throws MimeTypeParseException
      */
-    public Content setContent(Element element, String mediaType) {
+    public final Content AbderaEntry.setContent(Element element, String mediaType) {
         try {
             if (MimeTypeHelper.isText(mediaType))
                 throw new IllegalArgumentException();
@@ -172,7 +172,7 @@ public class FOMEntry extends FOMExtensi
      * 
      * @throws MimeTypeParseException
      */
-    public Content setContent(DataHandler dataHandler) {
+    public final Content AbderaEntry.setContent(DataHandler dataHandler) {
         return setContent(dataHandler, dataHandler.getContentType());
     }
 
@@ -181,7 +181,7 @@ public class FOMEntry extends FOMExtensi
      * 
      * @throws MimeTypeParseException
      */
-    public Content setContent(DataHandler dataHandler, String mediatype) {
+    public final Content AbderaEntry.setContent(DataHandler dataHandler, String mediatype) {
         if (MimeTypeHelper.isText(mediatype)) {
             try {
                 return setContent(dataHandler.getInputStream(), mediatype);
@@ -201,7 +201,7 @@ public class FOMEntry extends FOMExtensi
     /**
      * Sets the content for this entry
      */
-    public Content setContent(InputStream in) {
+    public final Content AbderaEntry.setContent(InputStream in) {
         InputStreamDataSource ds = new InputStreamDataSource(in);
         DataHandler dh = new DataHandler(ds);
         Content content = setContent(dh);
@@ -211,7 +211,7 @@ public class FOMEntry extends FOMExtensi
     /**
      * Sets the content for this entry
      */
-    public Content setContent(InputStream in, String mediatype) {
+    public final Content AbderaEntry.setContent(InputStream in, String mediatype) {
         if (MimeTypeHelper.isText(mediatype)) {
             try {
                 StringBuilder buf = new StringBuilder();
@@ -241,7 +241,7 @@ public class FOMEntry extends FOMExtensi
      * 
      * @throws MimeTypeParseException
      */
-    public Content setContent(String value, String mediatype) {
+    public final Content AbderaEntry.setContent(String value, String mediatype) {
         try {
             Content content = getFactory().newContent(new MimeType(mediatype));
             content.setValue(value);
@@ -259,7 +259,7 @@ public class FOMEntry extends FOMExtensi
      * @throws MimeTypeParseException
      * @throws IRISyntaxException
      */
-    public Content setContent(IRI uri, String mediatype) {
+    public final Content AbderaEntry.setContent(IRI uri, String mediatype) {
         try {
             Content content = getFactory().newContent(new MimeType(mediatype));
             content.setSrc(uri.toString());
@@ -270,22 +270,22 @@ public class FOMEntry extends FOMExtensi
         }
     }
 
-    public List<Person> getContributors() {
+    public final List<Person> AbderaEntry.getContributors() {
         return _getChildrenAsSet(CONTRIBUTOR);
     }
 
-    public Entry addContributor(Person person) {
+    public final Entry AbderaEntry.addContributor(Person person) {
         _addChild((AbderaPerson)person);
         return this;
     }
 
-    public Person addContributor(String name) {
+    public final Person AbderaEntry.addContributor(String name) {
         Person person = getFactory().newContributor(this);
         person.setName(name);
         return person;
     }
 
-    public Person addContributor(String name, String email, String uri) {
+    public final Person AbderaEntry.addContributor(String name, String email, String uri) {
         Person person = getFactory().newContributor(this);
         person.setName(name);
         person.setEmail(email);
@@ -293,29 +293,29 @@ public class FOMEntry extends FOMExtensi
         return person;
     }
 
-    public IRIElement getIdElement() {
+    public final IRIElement AbderaEntry.getIdElement() {
         return (IRIElement)_getFirstChildWithName(ID);
     }
 
-    public Entry setIdElement(IRIElement id) {
+    public final Entry AbderaEntry.setIdElement(IRIElement id) {
         _setChild(ID, id);
         return this;
     }
 
-    public IRI getId() {
+    public final IRI AbderaEntry.getId() {
         IRIElement id = getIdElement();
         return (id != null) ? id.getValue() : null;
     }
 
-    public IRIElement setId(String value) {
+    public final IRIElement AbderaEntry.setId(String value) {
         return setId(value, false);
     }
 
-    public IRIElement newId() {
+    public final IRIElement AbderaEntry.newId() {
         return setId(this.getFactory().newUuidUri(), false);
     }
 
-    public IRIElement setId(String value, boolean normalize) {
+    public final IRIElement AbderaEntry.setId(String value, boolean normalize) {
         if (value == null) {
             _removeChildren(ID, false);
             return null;
@@ -334,28 +334,20 @@ public class FOMEntry extends FOMExtensi
         }
     }
 
-    public List<Link> getLinks() {
+    public final List<Link> AbderaEntry.getLinks() {
         return _getChildrenAsSet(LINK);
     }
 
-    public List<Link> getLinks(String rel) {
-        return FOMHelper.getLinks(this, rel);
-    }
-
-    public List<Link> getLinks(String... rels) {
-        return FOMHelper.getLinks(this, rels);
-    }
-
-    public Entry addLink(Link link) {
+    public final Entry AbderaEntry.addLink(Link link) {
         _addChild((AbderaLink)link);
         return this;
     }
 
-    public Link addLink(String href) {
+    public final Link AbderaEntry.addLink(String href) {
         return addLink(href, null);
     }
 
-    public Link addLink(String href, String rel) {
+    public final Link AbderaEntry.addLink(String href, String rel) {
         Link link = getFactory().newLink(this);
         link.setHref(href);
         if (rel != null)
@@ -363,7 +355,7 @@ public class FOMEntry extends FOMExtensi
         return link;
     }
 
-    public Link addLink(String href, String rel, String type, String title, String hreflang, long length) {
+    public final Link AbderaEntry.addLink(String href, String rel, String type, String title, String hreflang, long length) {
         Link link = getFactory().newLink(this);
         link.setHref(href);
         link.setRel(rel);
@@ -374,21 +366,21 @@ public class FOMEntry extends FOMExtensi
         return link;
     }
 
-    public DateTime getPublishedElement() {
+    public final DateTime AbderaEntry.getPublishedElement() {
         return (DateTime)_getFirstChildWithName(PUBLISHED);
     }
 
-    public Entry setPublishedElement(DateTime dateTime) {
+    public final Entry AbderaEntry.setPublishedElement(DateTime dateTime) {
         _setChild(PUBLISHED, dateTime);
         return this;
     }
 
-    public Date getPublished() {
+    public final Date AbderaEntry.getPublished() {
         DateTime dte = getPublishedElement();
         return (dte != null) ? dte.getDate() : null;
     }
 
-    private DateTime setPublished(AtomDate value) {
+    private DateTime AbderaEntry.setPublished(AtomDate value) {
         if (value == null) {
             _removeChildren(PUBLISHED, false);
             return null;
@@ -404,166 +396,166 @@ public class FOMEntry extends FOMExtensi
         }
     }
 
-    public DateTime setPublished(Date value) {
+    public final DateTime AbderaEntry.setPublished(Date value) {
         return setPublished((value != null) ? AtomDate.valueOf(value) : null);
     }
 
-    public DateTime setPublished(String value) {
+    public final DateTime AbderaEntry.setPublished(String value) {
         return setPublished((value != null) ? AtomDate.valueOf(value) : null);
     }
 
-    public Text getRightsElement() {
+    public final Text AbderaEntry.getRightsElement() {
         return getTextElement(RIGHTS);
     }
 
-    public Entry setRightsElement(Text text) {
+    public final Entry AbderaEntry.setRightsElement(Text text) {
         setTextElement(RIGHTS, text, false);
         return this;
     }
 
-    public Text setRights(String value) {
+    public final Text AbderaEntry.setRights(String value) {
         Text text = getFactory().newRights();
         text.setValue(value);
         setRightsElement(text);
         return text;
     }
 
-    public Text setRightsAsHtml(String value) {
+    public final Text AbderaEntry.setRightsAsHtml(String value) {
         return setRights(value, Text.Type.HTML);
     }
 
-    public Text setRightsAsXhtml(String value) {
+    public final Text AbderaEntry.setRightsAsXhtml(String value) {
         return setRights(value, Text.Type.XHTML);
     }
 
-    public Text setRights(String value, Text.Type type) {
+    public final Text AbderaEntry.setRights(String value, Text.Type type) {
         Text text = getFactory().newRights(type);
         text.setValue(value);
         setRightsElement(text);
         return text;
     }
 
-    public Text setRights(Div value) {
+    public final Text AbderaEntry.setRights(Div value) {
         Text text = getFactory().newRights(Text.Type.XHTML);
         text.setValueElement(value);
         setRightsElement(text);
         return text;
     }
 
-    public String getRights() {
+    public final String AbderaEntry.getRights() {
         return getText(RIGHTS);
     }
 
-    public Source getSource() {
+    public final Source AbderaEntry.getSource() {
         return (Source)_getFirstChildWithName(SOURCE);
     }
 
-    public Entry setSource(Source source) {
+    public final Entry AbderaEntry.setSource(Source source) {
         if (source instanceof Feed)
             source = ((Feed)source).getAsSource();
         _setChild(SOURCE, source);
         return this;
     }
 
-    public Text getSummaryElement() {
+    public final Text AbderaEntry.getSummaryElement() {
         return getTextElement(SUMMARY);
     }
 
-    public Entry setSummaryElement(Text text) {
+    public final Entry AbderaEntry.setSummaryElement(Text text) {
         setTextElement(SUMMARY, text, false);
         return this;
     }
 
-    public Text setSummary(String value) {
+    public final Text AbderaEntry.setSummary(String value) {
         Text text = getFactory().newSummary();
         text.setValue(value);
         setSummaryElement(text);
         return text;
     }
 
-    public Text setSummaryAsHtml(String value) {
+    public final Text AbderaEntry.setSummaryAsHtml(String value) {
         return setSummary(value, Text.Type.HTML);
     }
 
-    public Text setSummaryAsXhtml(String value) {
+    public final Text AbderaEntry.setSummaryAsXhtml(String value) {
         return setSummary(value, Text.Type.XHTML);
     }
 
-    public Text setSummary(String value, Text.Type type) {
+    public final Text AbderaEntry.setSummary(String value, Text.Type type) {
         Text text = getFactory().newSummary(type);
         text.setValue(value);
         setSummaryElement(text);
         return text;
     }
 
-    public Text setSummary(Div value) {
+    public final Text AbderaEntry.setSummary(Div value) {
         Text text = getFactory().newSummary(Text.Type.XHTML);
         text.setValueElement(value);
         setSummaryElement(text);
         return text;
     }
 
-    public String getSummary() {
+    public final String AbderaEntry.getSummary() {
         return getText(SUMMARY);
     }
 
-    public Text getTitleElement() {
+    public final Text AbderaEntry.getTitleElement() {
         return getTextElement(TITLE);
     }
 
-    public Entry setTitleElement(Text title) {
+    public final Entry AbderaEntry.setTitleElement(Text title) {
         setTextElement(TITLE, title, false);
         return this;
     }
 
-    public Text setTitle(String value) {
+    public final Text AbderaEntry.setTitle(String value) {
         Text text = getFactory().newTitle();
         text.setValue(value);
         setTitleElement(text);
         return text;
     }
 
-    public Text setTitleAsHtml(String value) {
+    public final Text AbderaEntry.setTitleAsHtml(String value) {
         return setTitle(value, Text.Type.HTML);
     }
 
-    public Text setTitleAsXhtml(String value) {
+    public final Text AbderaEntry.setTitleAsXhtml(String value) {
         return setTitle(value, Text.Type.XHTML);
     }
 
-    public Text setTitle(String value, Text.Type type) {
+    public final Text AbderaEntry.setTitle(String value, Text.Type type) {
         Text text = getFactory().newTitle(type);
         text.setValue(value);
         setTitleElement(text);
         return text;
     }
 
-    public Text setTitle(Div value) {
+    public final Text AbderaEntry.setTitle(Div value) {
         Text text = getFactory().newTitle(Text.Type.XHTML);
         text.setValueElement(value);
         setTitleElement(text);
         return text;
     }
 
-    public String getTitle() {
+    public final String AbderaEntry.getTitle() {
         return getText(TITLE);
     }
 
-    public DateTime getUpdatedElement() {
+    public final DateTime AbderaEntry.getUpdatedElement() {
         return (DateTime)_getFirstChildWithName(UPDATED);
     }
 
-    public Entry setUpdatedElement(DateTime updated) {
+    public final Entry AbderaEntry.setUpdatedElement(DateTime updated) {
         _setChild(UPDATED, updated);
         return this;
     }
 
-    public Date getUpdated() {
+    public final Date AbderaEntry.getUpdated() {
         DateTime dte = getUpdatedElement();
         return (dte != null) ? dte.getDate() : null;
     }
 
-    private DateTime setUpdated(AtomDate value) {
+    private DateTime AbderaEntry.setUpdated(AtomDate value) {
         if (value == null) {
             _removeChildren(UPDATED, false);
             return null;
@@ -579,34 +571,34 @@ public class FOMEntry extends FOMExtensi
         }
     }
 
-    public DateTime setUpdated(Date value) {
+    public final DateTime AbderaEntry.setUpdated(Date value) {
         return setUpdated((value != null) ? AtomDate.valueOf(value) : null);
     }
 
-    public DateTime setUpdated(String value) {
+    public final DateTime AbderaEntry.setUpdated(String value) {
         return setUpdated((value != null) ? AtomDate.valueOf(value) : null);
     }
 
-    public DateTime getEditedElement() {
+    public final DateTime AbderaEntry.getEditedElement() {
         DateTime dt = (DateTime)_getFirstChildWithName(EDITED);
         if (dt == null)
             dt = (DateTime)_getFirstChildWithName(PRE_RFC_EDITED);
         return dt;
     }
 
-    public void setEditedElement(DateTime updated) {
-        declareNamespace(APP_NS, "app");
+    public final void AbderaEntry.setEditedElement(DateTime updated) {
+        declareNS(APP_NS, "app");
         _removeChildren(PRE_RFC_EDITED, false);
         _setChild(EDITED, updated);
     }
 
-    public Date getEdited() {
+    public final Date AbderaEntry.getEdited() {
         DateTime dte = getEditedElement();
         return (dte != null) ? dte.getDate() : null;
     }
 
-    private DateTime setEdited(AtomDate value) {
-        declareNamespace(APP_NS, "app");
+    private DateTime AbderaEntry.setEdited(AtomDate value) {
+        declareNS(APP_NS, "app");
         if (value == null) {
             _removeChildren(PRE_RFC_EDITED, false);
             _removeChildren(EDITED, false);
@@ -623,15 +615,15 @@ public class FOMEntry extends FOMExtensi
         }
     }
 
-    public DateTime setEdited(Date value) {
+    public final DateTime AbderaEntry.setEdited(Date value) {
         return setEdited((value != null) ? AtomDate.valueOf(value) : null);
     }
 
-    public DateTime setEdited(String value) {
+    public final DateTime AbderaEntry.setEdited(String value) {
         return setUpdated((value != null) ? AtomDate.valueOf(value) : null);
     }
 
-    public Control getControl(boolean create) {
+    public final Control AbderaEntry.getControl(boolean create) {
         Control control = getControl();
         if (control == null && create) {
             control = getFactory().newControl();
@@ -640,20 +632,20 @@ public class FOMEntry extends FOMExtensi
         return control;
     }
 
-    public Control getControl() {
+    public final Control AbderaEntry.getControl() {
         Control control = (Control)_getFirstChildWithName(CONTROL);
         if (control == null)
             control = (Control)_getFirstChildWithName(PRE_RFC_CONTROL);
         return control;
     }
 
-    public Entry setControl(Control control) {
+    public final Entry AbderaEntry.setControl(Control control) {
         _removeChildren(PRE_RFC_CONTROL, true);
         _setChild(CONTROL, control);
         return this;
     }
 
-    public Link getLink(String rel) {
+    public final Link AbderaEntry.getLink(String rel) {
         List<Link> links = getLinks(rel);
         Link link = null;
         if (links.size() > 0)
@@ -661,116 +653,116 @@ public class FOMEntry extends FOMExtensi
         return link;
     }
 
-    public Link getAlternateLink() {
+    public final Link AbderaEntry.getAlternateLink() {
         return getLink(Link.REL_ALTERNATE);
     }
 
-    public Link getEnclosureLink() {
+    public final Link AbderaEntry.getEnclosureLink() {
         return getLink(Link.REL_ENCLOSURE);
     }
 
-    public Link getEditLink() {
+    public final Link AbderaEntry.getEditLink() {
         return getLink(Link.REL_EDIT);
     }
 
-    public Link getSelfLink() {
+    public final Link AbderaEntry.getSelfLink() {
         return getLink(Link.REL_SELF);
     }
 
-    public Link getEditMediaLink() {
+    public final Link AbderaEntry.getEditMediaLink() {
         return getLink(Link.REL_EDIT_MEDIA);
     }
 
-    public IRI getLinkResolvedHref(String rel) {
+    public final IRI AbderaEntry.getLinkResolvedHref(String rel) {
         Link link = getLink(rel);
         return (link != null) ? link.getResolvedHref() : null;
     }
 
-    public IRI getAlternateLinkResolvedHref() {
+    public final IRI AbderaEntry.getAlternateLinkResolvedHref() {
         Link link = getAlternateLink();
         return (link != null) ? link.getResolvedHref() : null;
     }
 
-    public IRI getEnclosureLinkResolvedHref() {
+    public final IRI AbderaEntry.getEnclosureLinkResolvedHref() {
         Link link = getEnclosureLink();
         return (link != null) ? link.getResolvedHref() : null;
     }
 
-    public IRI getEditLinkResolvedHref() {
+    public final IRI AbderaEntry.getEditLinkResolvedHref() {
         Link link = getEditLink();
         return (link != null) ? link.getResolvedHref() : null;
     }
 
-    public IRI getEditMediaLinkResolvedHref() {
+    public final IRI AbderaEntry.getEditMediaLinkResolvedHref() {
         Link link = getEditMediaLink();
         return (link != null) ? link.getResolvedHref() : null;
     }
 
-    public IRI getSelfLinkResolvedHref() {
+    public final IRI AbderaEntry.getSelfLinkResolvedHref() {
         Link link = getSelfLink();
         return (link != null) ? link.getResolvedHref() : null;
     }
 
-    public String getContent() {
+    public final String AbderaEntry.getContent() {
         Content content = getContentElement();
         return (content != null) ? content.getValue() : null;
     }
 
-    public InputStream getContentStream() throws IOException {
+    public final InputStream AbderaEntry.getContentStream() throws IOException {
         Content content = getContentElement();
         DataHandler dh = content.getDataHandler();
         return dh.getInputStream();
     }
 
-    public IRI getContentSrc() {
+    public final IRI AbderaEntry.getContentSrc() {
         Content content = getContentElement();
         return (content != null) ? content.getResolvedSrc() : null;
     }
 
-    public Type getContentType() {
+    public final Type AbderaEntry.getContentType() {
         Content content = getContentElement();
         return (content != null) ? content.getContentType() : null;
     }
 
-    public Text.Type getRightsType() {
+    public final Text.Type AbderaEntry.getRightsType() {
         Text text = getRightsElement();
         return (text != null) ? text.getTextType() : null;
     }
 
-    public Text.Type getSummaryType() {
+    public final Text.Type AbderaEntry.getSummaryType() {
         Text text = getSummaryElement();
         return (text != null) ? text.getTextType() : null;
     }
 
-    public Text.Type getTitleType() {
+    public final Text.Type AbderaEntry.getTitleType() {
         Text text = getTitleElement();
         return (text != null) ? text.getTextType() : null;
     }
 
-    public MimeType getContentMimeType() {
+    public final MimeType AbderaEntry.getContentMimeType() {
         Content content = getContentElement();
         return (content != null) ? content.getMimeType() : null;
     }
 
-    public Link getAlternateLink(String type, String hreflang) {
-        return selectLink(getLinks(Link.REL_ALTERNATE), type, hreflang);
+    public final Link AbderaEntry.getAlternateLink(String type, String hreflang) {
+        return LinkUtil.selectLink(getLinks(Link.REL_ALTERNATE), type, hreflang);
     }
 
-    public IRI getAlternateLinkResolvedHref(String type, String hreflang) {
+    public final IRI AbderaEntry.getAlternateLinkResolvedHref(String type, String hreflang) {
         Link link = getAlternateLink(type, hreflang);
         return (link != null) ? link.getResolvedHref() : null;
     }
 
-    public Link getEditMediaLink(String type, String hreflang) {
-        return selectLink(getLinks(Link.REL_EDIT_MEDIA), type, hreflang);
+    public final Link AbderaEntry.getEditMediaLink(String type, String hreflang) {
+        return LinkUtil.selectLink(getLinks(Link.REL_EDIT_MEDIA), type, hreflang);
     }
 
-    public IRI getEditMediaLinkResolvedHref(String type, String hreflang) {
+    public final IRI AbderaEntry.getEditMediaLinkResolvedHref(String type, String hreflang) {
         Link link = getEditMediaLink(type, hreflang);
         return (link != null) ? link.getResolvedHref() : null;
     }
 
-    public Entry setDraft(boolean draft) {
+    public final Entry AbderaEntry.setDraft(boolean draft) {
         Control control = getControl();
         if (control == null && draft) {
             control = getFactory().newControl(this);
@@ -783,12 +775,12 @@ public class FOMEntry extends FOMExtensi
     /**
      * Returns true if this entry is a draft
      */
-    public boolean isDraft() {
+    public final boolean AbderaEntry.isDraft() {
         Control control = getControl();
         return (control != null) ? control.isDraft() : false;
     }
 
-    public Control addControl() {
+    public final Control AbderaEntry.addControl() {
         Control control = getControl();
         if (control == null) {
             control = getFactory().newControl(this);

Added: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/LinkUtil.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/LinkUtil.java?rev=1706568&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/LinkUtil.java (added)
+++ webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/LinkUtil.java Sat Oct  3 12:52:40 2015
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.fom;
+
+import java.util.List;
+
+import javax.activation.MimeType;
+
+import org.apache.abdera.model.Link;
+import org.apache.abdera.util.MimeTypeHelper;
+
+public final class LinkUtil {
+    private LinkUtil() {}
+
+    public static Link selectLink(List<Link> links, String type, String hreflang) {
+        for (Link link : links) {
+            MimeType mt = link.getMimeType();
+            boolean typematch = MimeTypeHelper.isMatch((mt != null) ? mt.toString() : null, type);
+            boolean langmatch =
+                "*".equals(hreflang) || ((hreflang != null) ? hreflang.equals(link.getHrefLang())
+                    : link.getHrefLang() == null);
+            if (typematch && langmatch)
+                return link;
+        }
+        return null;
+    }
+}

Propchange: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/LinkUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

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=1706568&r1=1706567&r2=1706568&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 Sat Oct  3 12:52:40 2015
@@ -36,7 +36,6 @@ import java.util.Locale;
 import java.util.Map;
 
 import javax.activation.DataHandler;
-import javax.activation.MimeType;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 
@@ -49,13 +48,11 @@ import org.apache.abdera.model.Content;
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.ElementWrapper;
-import org.apache.abdera.model.Link;
 import org.apache.abdera.model.Text;
 import org.apache.abdera.parser.ParseException;
 import org.apache.abdera.parser.Parser;
 import org.apache.abdera.parser.ParserOptions;
 import org.apache.abdera.parser.stax.util.FOMElementIteratorWrapper;
-import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.abdera.writer.Writer;
 import org.apache.abdera.writer.WriterOptions;
 import org.apache.axiom.core.Axis;
@@ -63,7 +60,6 @@ import org.apache.axiom.core.CoreChildNo
 import org.apache.axiom.core.CoreNSAwareElement;
 import org.apache.axiom.core.ElementMatcher;
 import org.apache.axiom.fom.AbderaElement;
-import org.apache.axiom.fom.AbderaText;
 import org.apache.axiom.fom.FOMExceptionTranslator;
 import org.apache.axiom.fom.FOMList;
 import org.apache.axiom.fom.IRIUtil;
@@ -359,11 +355,11 @@ public class FOMElement extends FOMChild
         return getMustPreserveWhitespace() || value == null ? value : value.trim();
     }
 
-    protected <T extends Text> T getTextElement(QName qname) {
+    public final <T extends Text> T getTextElement(QName qname) {
         return (T)_getFirstChildWithName(qname);
     }
 
-    protected <T extends Text> void setTextElement(QName qname, T text, boolean many) {
+    public final <T extends Text> void setTextElement(QName qname, T text, boolean many) {
         _setChild(qname, text);
     }
 
@@ -399,7 +395,7 @@ public class FOMElement extends FOMChild
         return getMustPreserveWhitespace() ? value : value.trim();
     }
 
-    protected String getText(QName qname) {
+    public final String getText(QName qname) {
         Text text = getTextElement(qname);
         return (text != null) ? text.getValue() : null;
     }
@@ -572,19 +568,6 @@ public class FOMElement extends FOMChild
         return locale;
     }
 
-    protected Link selectLink(List<Link> links, String type, String hreflang) {
-        for (Link link : links) {
-            MimeType mt = link.getMimeType();
-            boolean typematch = MimeTypeHelper.isMatch((mt != null) ? mt.toString() : null, type);
-            boolean langmatch =
-                "*".equals(hreflang) || ((hreflang != null) ? hreflang.equals(link.getHrefLang())
-                    : link.getHrefLang() == null);
-            if (typematch && langmatch)
-                return link;
-        }
-        return null;
-    }
-
     public <T extends Element> T declareNS(String uri, String prefix) {
         if (!isDeclared(uri, prefix)) {
             declareNamespace(uri, prefix);

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java?rev=1706568&r1=1706567&r2=1706568&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java (original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java Sat Oct  3 12:52:40 2015
@@ -17,327 +17,13 @@
  */
 package org.apache.abdera.parser.stax;
 
-import static org.apache.abdera.util.Constants.APP_NS;
-import static org.apache.abdera.util.Constants.AUTHOR;
-import static org.apache.abdera.util.Constants.CONTENT;
-import static org.apache.abdera.util.Constants.CONTRIBUTOR;
-import static org.apache.abdera.util.Constants.CONTROL;
-import static org.apache.abdera.util.Constants.EDITED;
-import static org.apache.abdera.util.Constants.ID;
-import static org.apache.abdera.util.Constants.LINK;
-import static org.apache.abdera.util.Constants.PRE_RFC_CONTROL;
-import static org.apache.abdera.util.Constants.PRE_RFC_EDITED;
-import static org.apache.abdera.util.Constants.PUBLISHED;
-import static org.apache.abdera.util.Constants.RIGHTS;
-import static org.apache.abdera.util.Constants.SOURCE;
-import static org.apache.abdera.util.Constants.SUMMARY;
-import static org.apache.abdera.util.Constants.TITLE;
-import static org.apache.abdera.util.Constants.UPDATED;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Date;
 import java.util.List;
 
-import javax.activation.DataHandler;
-import javax.activation.MimeType;
-
-import org.apache.abdera.i18n.iri.IRI;
-import org.apache.abdera.i18n.iri.IRISyntaxException;
-import org.apache.abdera.i18n.text.io.InputStreamDataSource;
-import org.apache.abdera.model.AtomDate;
-import org.apache.abdera.model.Category;
-import org.apache.abdera.model.Content;
-import org.apache.abdera.model.Content.Type;
-import org.apache.abdera.model.Control;
-import org.apache.abdera.model.DateTime;
-import org.apache.abdera.model.Div;
-import org.apache.abdera.model.Document;
-import org.apache.abdera.model.Element;
-import org.apache.abdera.model.Entry;
-import org.apache.abdera.model.Feed;
-import org.apache.abdera.model.IRIElement;
 import org.apache.abdera.model.Link;
-import org.apache.abdera.model.Person;
-import org.apache.abdera.model.Source;
-import org.apache.abdera.model.Text;
 import org.apache.abdera.parser.stax.util.FOMHelper;
-import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.axiom.fom.AbderaEntry;
-import org.apache.axiom.fom.AbderaLink;
-import org.apache.axiom.fom.AbderaPerson;
 
-@SuppressWarnings( {"unchecked", "deprecation"})
 public class FOMEntry extends FOMExtensibleElement implements AbderaEntry {
-    public Person getAuthor() {
-        return (Person)_getFirstChildWithName(AUTHOR);
-    }
-
-    public List<Person> getAuthors() {
-        return _getChildrenAsSet(AUTHOR);
-    }
-
-    public Entry addAuthor(Person person) {
-        _addChild((AbderaPerson)person);
-        return this;
-    }
-
-    public Person addAuthor(String name) {
-        Person person = getFactory().newAuthor(this);
-        person.setName(name);
-        return person;
-    }
-
-    public Person addAuthor(String name, String email, String uri) {
-        Person person = getFactory().newAuthor(this);
-        person.setName(name);
-        person.setEmail(email);
-        person.setUri(uri);
-        return person;
-    }
-
-    public Entry addCategory(Category category) {
-        internalAddCategory(category);
-        return this;
-    }
-
-    public Content getContentElement() {
-        return (Content)_getFirstChildWithName(CONTENT);
-    }
-
-    public Entry setContentElement(Content content) {
-        _setChild(CONTENT, content);
-        return this;
-    }
-
-    /**
-     * Sets the content for this entry as @type="text"
-     */
-    public Content setContent(String value) {
-        Content content = getFactory().newContent();
-        content.setValue(value);
-        setContentElement(content);
-        return content;
-    }
-
-    public Content setContentAsHtml(String value) {
-        return setContent(value, Content.Type.HTML);
-    }
-
-    public Content setContentAsXhtml(String value) {
-        return setContent(value, Content.Type.XHTML);
-    }
-
-    /**
-     * Sets the content for this entry
-     */
-    public Content setContent(String value, Content.Type type) {
-        Content content = getFactory().newContent(type);
-        content.setValue(value);
-        setContentElement(content);
-        return content;
-    }
-
-    /**
-     * Sets the content for this entry
-     */
-    public Content setContent(Element value) {
-        Content content = getFactory().newContent();
-        content.setValueElement(value);
-        setContentElement(content);
-        return content;
-    }
-
-    /**
-     * Sets the content for this entry
-     * 
-     * @throws MimeTypeParseException
-     */
-    public Content setContent(Element element, String mediaType) {
-        try {
-            if (MimeTypeHelper.isText(mediaType))
-                throw new IllegalArgumentException();
-            Content content = getFactory().newContent(new MimeType(mediaType));
-            content.setValueElement(element);
-            setContentElement(content);
-            return content;
-        } catch (javax.activation.MimeTypeParseException e) {
-            throw new org.apache.abdera.util.MimeTypeParseException(e);
-        }
-    }
-
-    /**
-     * Sets the content for this entry
-     * 
-     * @throws MimeTypeParseException
-     */
-    public Content setContent(DataHandler dataHandler) {
-        return setContent(dataHandler, dataHandler.getContentType());
-    }
-
-    /**
-     * Sets the content for this entry
-     * 
-     * @throws MimeTypeParseException
-     */
-    public Content setContent(DataHandler dataHandler, String mediatype) {
-        if (MimeTypeHelper.isText(mediatype)) {
-            try {
-                return setContent(dataHandler.getInputStream(), mediatype);
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
-        } else {
-            Content content = getFactory().newContent(Content.Type.MEDIA);
-            content.setDataHandler(dataHandler);
-            if (mediatype != null)
-                content.setMimeType(mediatype);
-            setContentElement(content);
-            return content;
-        }
-    }
-
-    /**
-     * Sets the content for this entry
-     */
-    public Content setContent(InputStream in) {
-        InputStreamDataSource ds = new InputStreamDataSource(in);
-        DataHandler dh = new DataHandler(ds);
-        Content content = setContent(dh);
-        return content;
-    }
-
-    /**
-     * Sets the content for this entry
-     */
-    public Content setContent(InputStream in, String mediatype) {
-        if (MimeTypeHelper.isText(mediatype)) {
-            try {
-                StringBuilder buf = new StringBuilder();
-                String charset = MimeTypeHelper.getCharset(mediatype);
-                Document doc = this.getDocument();
-                charset = charset != null ? charset : doc != null ? doc.getCharset() : null;
-                charset = charset != null ? charset : "UTF-8";
-                InputStreamReader isr = new InputStreamReader(in, charset);
-                char[] data = new char[500];
-                int r = -1;
-                while ((r = isr.read(data)) != -1) {
-                    buf.append(data, 0, r);
-                }
-                return setContent(buf.toString(), mediatype);
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
-        } else {
-            InputStreamDataSource ds = new InputStreamDataSource(in, mediatype);
-            DataHandler dh = new DataHandler(ds);
-            return setContent(dh, mediatype);
-        }
-    }
-
-    /**
-     * Sets the content for this entry
-     * 
-     * @throws MimeTypeParseException
-     */
-    public Content setContent(String value, String mediatype) {
-        try {
-            Content content = getFactory().newContent(new MimeType(mediatype));
-            content.setValue(value);
-            content.setMimeType(mediatype);
-            setContentElement(content);
-            return content;
-        } catch (javax.activation.MimeTypeParseException e) {
-            throw new org.apache.abdera.util.MimeTypeParseException(e);
-        }
-    }
-
-    /**
-     * Sets the content for this entry
-     * 
-     * @throws MimeTypeParseException
-     * @throws IRISyntaxException
-     */
-    public Content setContent(IRI uri, String mediatype) {
-        try {
-            Content content = getFactory().newContent(new MimeType(mediatype));
-            content.setSrc(uri.toString());
-            setContentElement(content);
-            return content;
-        } catch (javax.activation.MimeTypeParseException e) {
-            throw new org.apache.abdera.util.MimeTypeParseException(e);
-        }
-    }
-
-    public List<Person> getContributors() {
-        return _getChildrenAsSet(CONTRIBUTOR);
-    }
-
-    public Entry addContributor(Person person) {
-        _addChild((AbderaPerson)person);
-        return this;
-    }
-
-    public Person addContributor(String name) {
-        Person person = getFactory().newContributor(this);
-        person.setName(name);
-        return person;
-    }
-
-    public Person addContributor(String name, String email, String uri) {
-        Person person = getFactory().newContributor(this);
-        person.setName(name);
-        person.setEmail(email);
-        person.setUri(uri);
-        return person;
-    }
-
-    public IRIElement getIdElement() {
-        return (IRIElement)_getFirstChildWithName(ID);
-    }
-
-    public Entry setIdElement(IRIElement id) {
-        _setChild(ID, id);
-        return this;
-    }
-
-    public IRI getId() {
-        IRIElement id = getIdElement();
-        return (id != null) ? id.getValue() : null;
-    }
-
-    public IRIElement setId(String value) {
-        return setId(value, false);
-    }
-
-    public IRIElement newId() {
-        return setId(this.getFactory().newUuidUri(), false);
-    }
-
-    public IRIElement setId(String value, boolean normalize) {
-        if (value == null) {
-            _removeChildren(ID, false);
-            return null;
-        }
-        IRIElement id = getIdElement();
-        if (id != null) {
-            if (normalize)
-                id.setNormalizedValue(value);
-            else
-                id.setValue(value);
-            return id;
-        } else {
-            IRIElement iri = getFactory().newID(this);
-            iri.setValue((normalize) ? IRI.normalizeString(value) : value);
-            return iri;
-        }
-    }
-
-    public List<Link> getLinks() {
-        return _getChildrenAsSet(LINK);
-    }
-
     public List<Link> getLinks(String rel) {
         return FOMHelper.getLinks(this, rel);
     }
@@ -345,454 +31,4 @@ public class FOMEntry extends FOMExtensi
     public List<Link> getLinks(String... rels) {
         return FOMHelper.getLinks(this, rels);
     }
-
-    public Entry addLink(Link link) {
-        _addChild((AbderaLink)link);
-        return this;
-    }
-
-    public Link addLink(String href) {
-        return addLink(href, null);
-    }
-
-    public Link addLink(String href, String rel) {
-        Link link = getFactory().newLink(this);
-        link.setHref(href);
-        if (rel != null)
-            link.setRel(rel);
-        return link;
-    }
-
-    public Link addLink(String href, String rel, String type, String title, String hreflang, long length) {
-        Link link = getFactory().newLink(this);
-        link.setHref(href);
-        link.setRel(rel);
-        link.setMimeType(type);
-        link.setTitle(title);
-        link.setHrefLang(hreflang);
-        link.setLength(length);
-        return link;
-    }
-
-    public DateTime getPublishedElement() {
-        return (DateTime)_getFirstChildWithName(PUBLISHED);
-    }
-
-    public Entry setPublishedElement(DateTime dateTime) {
-        _setChild(PUBLISHED, dateTime);
-        return this;
-    }
-
-    public Date getPublished() {
-        DateTime dte = getPublishedElement();
-        return (dte != null) ? dte.getDate() : null;
-    }
-
-    private DateTime setPublished(AtomDate value) {
-        if (value == null) {
-            _removeChildren(PUBLISHED, false);
-            return null;
-        }
-        DateTime dte = getPublishedElement();
-        if (dte != null) {
-            dte.setValue(value);
-            return dte;
-        } else {
-            DateTime dt = getFactory().newPublished(this);
-            dt.setValue(value);
-            return dt;
-        }
-    }
-
-    public DateTime setPublished(Date value) {
-        return setPublished((value != null) ? AtomDate.valueOf(value) : null);
-    }
-
-    public DateTime setPublished(String value) {
-        return setPublished((value != null) ? AtomDate.valueOf(value) : null);
-    }
-
-    public Text getRightsElement() {
-        return getTextElement(RIGHTS);
-    }
-
-    public Entry setRightsElement(Text text) {
-        setTextElement(RIGHTS, text, false);
-        return this;
-    }
-
-    public Text setRights(String value) {
-        Text text = getFactory().newRights();
-        text.setValue(value);
-        setRightsElement(text);
-        return text;
-    }
-
-    public Text setRightsAsHtml(String value) {
-        return setRights(value, Text.Type.HTML);
-    }
-
-    public Text setRightsAsXhtml(String value) {
-        return setRights(value, Text.Type.XHTML);
-    }
-
-    public Text setRights(String value, Text.Type type) {
-        Text text = getFactory().newRights(type);
-        text.setValue(value);
-        setRightsElement(text);
-        return text;
-    }
-
-    public Text setRights(Div value) {
-        Text text = getFactory().newRights(Text.Type.XHTML);
-        text.setValueElement(value);
-        setRightsElement(text);
-        return text;
-    }
-
-    public String getRights() {
-        return getText(RIGHTS);
-    }
-
-    public Source getSource() {
-        return (Source)_getFirstChildWithName(SOURCE);
-    }
-
-    public Entry setSource(Source source) {
-        if (source instanceof Feed)
-            source = ((Feed)source).getAsSource();
-        _setChild(SOURCE, source);
-        return this;
-    }
-
-    public Text getSummaryElement() {
-        return getTextElement(SUMMARY);
-    }
-
-    public Entry setSummaryElement(Text text) {
-        setTextElement(SUMMARY, text, false);
-        return this;
-    }
-
-    public Text setSummary(String value) {
-        Text text = getFactory().newSummary();
-        text.setValue(value);
-        setSummaryElement(text);
-        return text;
-    }
-
-    public Text setSummaryAsHtml(String value) {
-        return setSummary(value, Text.Type.HTML);
-    }
-
-    public Text setSummaryAsXhtml(String value) {
-        return setSummary(value, Text.Type.XHTML);
-    }
-
-    public Text setSummary(String value, Text.Type type) {
-        Text text = getFactory().newSummary(type);
-        text.setValue(value);
-        setSummaryElement(text);
-        return text;
-    }
-
-    public Text setSummary(Div value) {
-        Text text = getFactory().newSummary(Text.Type.XHTML);
-        text.setValueElement(value);
-        setSummaryElement(text);
-        return text;
-    }
-
-    public String getSummary() {
-        return getText(SUMMARY);
-    }
-
-    public Text getTitleElement() {
-        return getTextElement(TITLE);
-    }
-
-    public Entry setTitleElement(Text title) {
-        setTextElement(TITLE, title, false);
-        return this;
-    }
-
-    public Text setTitle(String value) {
-        Text text = getFactory().newTitle();
-        text.setValue(value);
-        setTitleElement(text);
-        return text;
-    }
-
-    public Text setTitleAsHtml(String value) {
-        return setTitle(value, Text.Type.HTML);
-    }
-
-    public Text setTitleAsXhtml(String value) {
-        return setTitle(value, Text.Type.XHTML);
-    }
-
-    public Text setTitle(String value, Text.Type type) {
-        Text text = getFactory().newTitle(type);
-        text.setValue(value);
-        setTitleElement(text);
-        return text;
-    }
-
-    public Text setTitle(Div value) {
-        Text text = getFactory().newTitle(Text.Type.XHTML);
-        text.setValueElement(value);
-        setTitleElement(text);
-        return text;
-    }
-
-    public String getTitle() {
-        return getText(TITLE);
-    }
-
-    public DateTime getUpdatedElement() {
-        return (DateTime)_getFirstChildWithName(UPDATED);
-    }
-
-    public Entry setUpdatedElement(DateTime updated) {
-        _setChild(UPDATED, updated);
-        return this;
-    }
-
-    public Date getUpdated() {
-        DateTime dte = getUpdatedElement();
-        return (dte != null) ? dte.getDate() : null;
-    }
-
-    private DateTime setUpdated(AtomDate value) {
-        if (value == null) {
-            _removeChildren(UPDATED, false);
-            return null;
-        }
-        DateTime dte = getUpdatedElement();
-        if (dte != null) {
-            dte.setValue(value);
-            return dte;
-        } else {
-            DateTime dt = getFactory().newUpdated(this);
-            dt.setValue(value);
-            return dt;
-        }
-    }
-
-    public DateTime setUpdated(Date value) {
-        return setUpdated((value != null) ? AtomDate.valueOf(value) : null);
-    }
-
-    public DateTime setUpdated(String value) {
-        return setUpdated((value != null) ? AtomDate.valueOf(value) : null);
-    }
-
-    public DateTime getEditedElement() {
-        DateTime dt = (DateTime)_getFirstChildWithName(EDITED);
-        if (dt == null)
-            dt = (DateTime)_getFirstChildWithName(PRE_RFC_EDITED);
-        return dt;
-    }
-
-    public void setEditedElement(DateTime updated) {
-        declareNamespace(APP_NS, "app");
-        _removeChildren(PRE_RFC_EDITED, false);
-        _setChild(EDITED, updated);
-    }
-
-    public Date getEdited() {
-        DateTime dte = getEditedElement();
-        return (dte != null) ? dte.getDate() : null;
-    }
-
-    private DateTime setEdited(AtomDate value) {
-        declareNamespace(APP_NS, "app");
-        if (value == null) {
-            _removeChildren(PRE_RFC_EDITED, false);
-            _removeChildren(EDITED, false);
-            return null;
-        }
-        DateTime dte = getEditedElement();
-        if (dte != null) {
-            dte.setValue(value);
-            return dte;
-        } else {
-            DateTime dt = getFactory().newEdited(this);
-            dt.setValue(value);
-            return dt;
-        }
-    }
-
-    public DateTime setEdited(Date value) {
-        return setEdited((value != null) ? AtomDate.valueOf(value) : null);
-    }
-
-    public DateTime setEdited(String value) {
-        return setUpdated((value != null) ? AtomDate.valueOf(value) : null);
-    }
-
-    public Control getControl(boolean create) {
-        Control control = getControl();
-        if (control == null && create) {
-            control = getFactory().newControl();
-            setControl(control);
-        }
-        return control;
-    }
-
-    public Control getControl() {
-        Control control = (Control)_getFirstChildWithName(CONTROL);
-        if (control == null)
-            control = (Control)_getFirstChildWithName(PRE_RFC_CONTROL);
-        return control;
-    }
-
-    public Entry setControl(Control control) {
-        _removeChildren(PRE_RFC_CONTROL, true);
-        _setChild(CONTROL, control);
-        return this;
-    }
-
-    public Link getLink(String rel) {
-        List<Link> links = getLinks(rel);
-        Link link = null;
-        if (links.size() > 0)
-            link = links.get(0);
-        return link;
-    }
-
-    public Link getAlternateLink() {
-        return getLink(Link.REL_ALTERNATE);
-    }
-
-    public Link getEnclosureLink() {
-        return getLink(Link.REL_ENCLOSURE);
-    }
-
-    public Link getEditLink() {
-        return getLink(Link.REL_EDIT);
-    }
-
-    public Link getSelfLink() {
-        return getLink(Link.REL_SELF);
-    }
-
-    public Link getEditMediaLink() {
-        return getLink(Link.REL_EDIT_MEDIA);
-    }
-
-    public IRI getLinkResolvedHref(String rel) {
-        Link link = getLink(rel);
-        return (link != null) ? link.getResolvedHref() : null;
-    }
-
-    public IRI getAlternateLinkResolvedHref() {
-        Link link = getAlternateLink();
-        return (link != null) ? link.getResolvedHref() : null;
-    }
-
-    public IRI getEnclosureLinkResolvedHref() {
-        Link link = getEnclosureLink();
-        return (link != null) ? link.getResolvedHref() : null;
-    }
-
-    public IRI getEditLinkResolvedHref() {
-        Link link = getEditLink();
-        return (link != null) ? link.getResolvedHref() : null;
-    }
-
-    public IRI getEditMediaLinkResolvedHref() {
-        Link link = getEditMediaLink();
-        return (link != null) ? link.getResolvedHref() : null;
-    }
-
-    public IRI getSelfLinkResolvedHref() {
-        Link link = getSelfLink();
-        return (link != null) ? link.getResolvedHref() : null;
-    }
-
-    public String getContent() {
-        Content content = getContentElement();
-        return (content != null) ? content.getValue() : null;
-    }
-
-    public InputStream getContentStream() throws IOException {
-        Content content = getContentElement();
-        DataHandler dh = content.getDataHandler();
-        return dh.getInputStream();
-    }
-
-    public IRI getContentSrc() {
-        Content content = getContentElement();
-        return (content != null) ? content.getResolvedSrc() : null;
-    }
-
-    public Type getContentType() {
-        Content content = getContentElement();
-        return (content != null) ? content.getContentType() : null;
-    }
-
-    public Text.Type getRightsType() {
-        Text text = getRightsElement();
-        return (text != null) ? text.getTextType() : null;
-    }
-
-    public Text.Type getSummaryType() {
-        Text text = getSummaryElement();
-        return (text != null) ? text.getTextType() : null;
-    }
-
-    public Text.Type getTitleType() {
-        Text text = getTitleElement();
-        return (text != null) ? text.getTextType() : null;
-    }
-
-    public MimeType getContentMimeType() {
-        Content content = getContentElement();
-        return (content != null) ? content.getMimeType() : null;
-    }
-
-    public Link getAlternateLink(String type, String hreflang) {
-        return selectLink(getLinks(Link.REL_ALTERNATE), type, hreflang);
-    }
-
-    public IRI getAlternateLinkResolvedHref(String type, String hreflang) {
-        Link link = getAlternateLink(type, hreflang);
-        return (link != null) ? link.getResolvedHref() : null;
-    }
-
-    public Link getEditMediaLink(String type, String hreflang) {
-        return selectLink(getLinks(Link.REL_EDIT_MEDIA), type, hreflang);
-    }
-
-    public IRI getEditMediaLinkResolvedHref(String type, String hreflang) {
-        Link link = getEditMediaLink(type, hreflang);
-        return (link != null) ? link.getResolvedHref() : null;
-    }
-
-    public Entry setDraft(boolean draft) {
-        Control control = getControl();
-        if (control == null && draft) {
-            control = getFactory().newControl(this);
-        }
-        if (control != null)
-            control.setDraft(draft);
-        return this;
-    }
-
-    /**
-     * Returns true if this entry is a draft
-     */
-    public boolean isDraft() {
-        Control control = getControl();
-        return (control != null) ? control.isDraft() : false;
-    }
-
-    public Control addControl() {
-        Control control = getControl();
-        if (control == null) {
-            control = getFactory().newControl(this);
-        }
-        return control;
-    }
 }

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMSource.java?rev=1706568&r1=1706567&r2=1706568&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMSource.java (original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMSource.java Sat Oct  3 12:52:40 2015
@@ -54,6 +54,7 @@ import org.apache.abdera.parser.stax.uti
 import org.apache.axiom.fom.AbderaLink;
 import org.apache.axiom.fom.AbderaPerson;
 import org.apache.axiom.fom.AbderaSource;
+import org.apache.axiom.fom.LinkUtil;
 import org.apache.axiom.om.OMNode;
 
 @SuppressWarnings( {"unchecked", "deprecation"})
@@ -493,7 +494,7 @@ public class FOMSource extends FOMExtens
     }
 
     public Link getAlternateLink(String type, String hreflang) {
-        return selectLink(getLinks(Link.REL_ALTERNATE), type, hreflang);
+        return LinkUtil.selectLink(getLinks(Link.REL_ALTERNATE), type, hreflang);
     }
 
     public IRI getAlternateLinkResolvedHref(String type, String hreflang) {



Mime
View raw message