abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r601147 [2/3] - in /incubator/abdera/java/trunk: build/ client/src/main/java/org/apache/abdera/protocol/client/ contrib/rss/src/main/java/org/apache/abdera/contrib/rss/ core/src/main/java/org/apache/abdera/factory/ core/src/main/java/org/ap...
Date Tue, 04 Dec 2007 23:23:42 GMT
Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java Tue Dec  4 15:23:33 2007
@@ -48,7 +48,7 @@
    * Sets the root element of the document
    * @param root Set the root element of the document
    */
-  void setRoot(T root);
+  Document<T> setRoot(T root);
   
   /**
    * Returns the Base URI of the document.  All relative URI's contained in the
@@ -63,7 +63,7 @@
    * @param base The Base URI
    * @throws IRISyntaxException if the IRI is malformed 
    */
-  void setBaseUri(String base);
+  Document<T> setBaseUri(String base);
   
   /**
    * Returns the content type of this document
@@ -76,7 +76,7 @@
    * @param contentType The content type of document
    * @throws MimeTypeParseException if the content type is malformed
    */
-  void setContentType(String contentType);
+  Document<T> setContentType(String contentType);
   
   /**
    * Returns the last modified date for this document
@@ -88,7 +88,7 @@
    * Sets the last modified date for this document
    * @param lastModified the last-modified date
    */
-  void setLastModified(Date lastModified);
+  Document<T> setLastModified(Date lastModified);
   
   /**
    * Gets the charset used for this document
@@ -100,14 +100,14 @@
    * Sets the charset used for this document
    * @param charset The character encoding to use
    */
-  void setCharset(String charset);
+  Document<T> setCharset(String charset);
   
   /**
    * Add a processing instruction to the document
    * @param target The processing instruction target
    * @param value The processing instruction value
    */
-  void addProcessingInstruction(String target, String value);
+  Document<T> addProcessingInstruction(String target, String value);
   
   /**
    * Get the values for the given processing instruction
@@ -119,7 +119,7 @@
    * @param href The href of the stylesheet
    * @param media The media target for this stylesheet or null if none
    */
-  void addStylesheet(String href, String media);
+  Document<T> addStylesheet(String href, String media);
   
   /**
    * Return the entity tag for this document
@@ -129,12 +129,12 @@
   /**
    * Set the entity tag for this document
    */
-  void setEntityTag(EntityTag tag);
+  Document<T> setEntityTag(EntityTag tag);
   
   /**
    * Set the entity tag for this document
    */
-  void setEntityTag(String tag);
+  Document<T> setEntityTag(String tag);
   
   /**
    * Get the language
@@ -149,7 +149,7 @@
   /**
    * set the base language
    */
-  void setLanguage(String lang);
+  Document<T> setLanguage(String lang);
   
   /**
    * Get the slug for this document
@@ -159,7 +159,7 @@
   /**
    * Set the slug for this document
    */
-  void setSlug(String slug);
+  Document<T> setSlug(String slug);
   
   /**
    * Return true if insignificant whitespace must be preserved
@@ -169,7 +169,7 @@
   /**
    * Set to true to preserve insignificant whitespace
    */
-  void setMustPreserveWhitespace(boolean preserve);
+  Document<T> setMustPreserveWhitespace(boolean preserve);
   
   /**
    * Get the XMLVersion used by this document

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java Tue Dec  4 15:23:33 2007
@@ -45,7 +45,7 @@
    * Set this Element's parent element
    * @param parent The parent element
    */
-  void setParentElement(Element parent);
+  <T extends Element>T setParentElement(Element parent);
   
   /**
    * Get the element preceding this one
@@ -114,7 +114,7 @@
    * Sets the value of this elements <code>xml:lang</code> attribute.
    * @param language the value of the xml:lang element
    */
-  void setLanguage(String language);
+  <T extends Element>T setLanguage(String language);
   
   /**
    * Returns the value of this element's <code>xml:base</code> attribute or
@@ -134,14 +134,14 @@
    * Sets the value of this element's <code>xml:base</code> attribute.
    * @param base The IRI base value
    */
-  void setBaseUri(IRI base);
+  <T extends Element>T setBaseUri(IRI base);
   
   /**
    * Sets the value of this element's <code>xml:base</code> attribute.
    * @param base The Base IRI
    * @throws IRISyntaxException if the base URI is malformed 
    */
-  void setBaseUri(String base);
+  <T extends Element>T setBaseUri(String base);
   
   /**
    * Returns the document to which this element belongs
@@ -181,27 +181,27 @@
    * Remove the named Attribute
    * @param qname The XML QName of the attribute to remove
    */
-  void removeAttribute(QName qname);
+  <T extends Element>T removeAttribute(QName qname);
   
   /**
    * Remove the named attribute
    * @param name The name of the attribute to remove
    */
-  void removeAttribute(String name);
+  <T extends Element>T removeAttribute(String name);
   
   /**
    * Sets the value of the named attribute
    * @param name The name of the attribute
    * @param value The value of the attribute
    */
-  void setAttributeValue(String name, String value);
+  <T extends Element>T setAttributeValue(String name, String value);
 
   /**
    * Sets the value of the named attribute
    * @param qname The XML QName of the attribute
    * @param value The value of the attribute
    */
-  void setAttributeValue(QName qname, String value);
+  <T extends Element>T setAttributeValue(QName qname, String value);
   
   /**
    * Removes this element from its current document
@@ -218,17 +218,17 @@
    * Set the Text value of this element
    * @param text The text value
    */
-  void setText(String text);
+  <T extends Element>T setText(String text);
   
   /**
    * Set the Text value of this element using the data handler
    */
-  void setText(DataHandler dataHandler);
+  <T extends Element>T setText(DataHandler dataHandler);
   
   /**
    * Declare a namespace
    */
-  void declareNS(String uri, String prefix);
+  <T extends Element>T declareNS(String uri, String prefix);
   
   /**
    * Return a map listing the xml namespaces declared for this element
@@ -248,5 +248,5 @@
   /**
    * Set to true to preserve insignificant whitespace
    */
-  void setMustPreserveWhitespace(boolean preserve);
+  <T extends Element>T setMustPreserveWhitespace(boolean preserve);
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java Tue Dec  4 15:23:33 2007
@@ -36,6 +36,7 @@
 /**
  * Base implementation used for static extensions.
  */
+@SuppressWarnings("unchecked") 
 public abstract class ElementWrapper 
   implements Element {
 
@@ -52,9 +53,10 @@
       ((ElementWrapper)el).getInternal() : el;
   }
 
-  public void addComment(
+  public <T extends Base>T addComment(
     String value) {
       internal.addComment(value);
+      return (T)this;
   }
 
   public Object clone() {
@@ -68,8 +70,9 @@
     }
   }
 
-  public void declareNS(String uri, String prefix) {
+  public <T extends Element>T declareNS(String uri, String prefix) {
     internal.declareNS(uri, prefix);
+    return (T)this;
   }
 
   public void discard() {
@@ -163,44 +166,54 @@
     return internal.getText();
   }
 
-  public void removeAttribute(QName qname) {
+  public <T extends Element>T removeAttribute(QName qname) {
     internal.removeAttribute(qname);
+    return (T)this;
   }
 
-  public void removeAttribute(String name) {
+  public <T extends Element>T removeAttribute(String name) {
     internal.removeAttribute(name);
+    return (T)this;
   }
   
-  public void setAttributeValue(QName qname, String value) {
+  public <T extends Element>T setAttributeValue(QName qname, String value) {
     internal.setAttributeValue(qname, value);
+    return (T)this;
   }
 
-  public void setAttributeValue(String name, String value) {
+  public <T extends Element>T setAttributeValue(String name, String value) {
     internal.setAttributeValue(name, value);
+    return (T)this;
   }
 
-  public void setBaseUri(IRI base) {
+  public <T extends Element>T setBaseUri(IRI base) {
     internal.setBaseUri(base);
+    return (T)this;
   }
 
-  public void setBaseUri(String base) {
+  public <T extends Element>T setBaseUri(String base) {
     internal.setBaseUri(base);
+    return (T)this;
   }
 
-  public void setLanguage(String language) {
+  public <T extends Element>T setLanguage(String language) {
     internal.setLanguage(language);
+    return (T)this;
   }
 
-  public void setParentElement(Element parent) {
+  public <T extends Element>T setParentElement(Element parent) {
     internal.setParentElement(parent);
+    return (T)this;
   }
 
-  public void setText(String text) {
+  public <T extends Element>T setText(String text) {
     internal.setText(text);
+    return (T)this;
   }
 
-  public void setText(DataHandler handler) {
+  public <T extends Element>T setText(DataHandler handler) {
     internal.setText(handler);
+    return (T)this;
   }
   
   public void writeTo(OutputStream out) throws IOException {
@@ -241,8 +254,9 @@
     return internal.getMustPreserveWhitespace();
   }
 
-  public void setMustPreserveWhitespace(boolean preserve) {
+  public <T extends Element>T setMustPreserveWhitespace(boolean preserve) {
     internal.setMustPreserveWhitespace(preserve);
+    return (T)this;
   }
 
   public void writeTo(OutputStream out, WriterOptions options) throws IOException {
@@ -289,8 +303,9 @@
     return internal.getDefaultWriterOptions();
   }
   
-  public void complete() {
+  public <T extends Base>T complete() {
     internal.complete();
+    return (T)this;
   }
   
   public Iterator<Element> iterator() {

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java Tue Dec  4 15:23:33 2007
@@ -121,7 +121,7 @@
    * Adds an individual author to the entry
    * @param person The person to add
    */
-  void addAuthor(Person person);
+  Entry addAuthor(Person person);
 
   /**
    * Adds an author
@@ -157,7 +157,7 @@
    * Adds an individual category to the entry
    * @param category The atom:category element to add
    */
-  void addCategory(Category category);
+  Entry addCategory(Category category);
   
   /**
    * Adds a category to the entry
@@ -186,7 +186,7 @@
    * Sets the content for this entry
    * @param content The atom:content element
    */
-  void setContentElement(Content content);
+  Entry setContentElement(Content content);
 
   /**
    * Sets the content for this entry as @type="text"
@@ -327,7 +327,7 @@
    * Adds an individual contributor to this entry
    * @param person The atom:contributor element
    */
-  void addContributor(Person person);
+  Entry addContributor(Person person);
   
   /**
    * Adds a contributor 
@@ -356,7 +356,7 @@
    * Sets the universally unique identifier for this entry
    * @param id The atom:id element
    */
-  void setIdElement(IRIElement id);
+  Entry setIdElement(IRIElement id);
   
   /**
    * Returns the universally unique identifier for this entry
@@ -410,7 +410,7 @@
    * Adds an individual link to the entry
    * @param link the atom:link to add
    */
-  void addLink(Link link);
+  Entry addLink(Link link);
   
   /**
    * Add a link to the entry
@@ -457,7 +457,7 @@
    * creation or first availability of the resource.
    * @param dateTime the atom:published element
    */
-  void setPublishedElement(DateTime dateTime);
+  Entry setPublishedElement(DateTime dateTime);
   
   /**
    * Return the value of the atom:published element
@@ -499,7 +499,7 @@
    * 
    * @param text The atom:rights element
    */
-  void setRightsElement(Text text);
+  Entry setRightsElement(Text text);
   
   /**
    * Sets the value of the rights as @type="text"
@@ -583,7 +583,7 @@
    * 
    * @param source The atom:source element
    */
-  void setSource(Source source);
+  Entry setSource(Source source);
   
   /**
    * RFC4287: The "atom:summary" element is a Text construct that conveys 
@@ -605,7 +605,7 @@
    * 
    * @param text The atom:summary element
    */
-  void setSummaryElement(Text text);
+  Entry setSummaryElement(Text text);
   
   /**
    * Sets the value of the summary as @type="text"
@@ -668,7 +668,7 @@
    * human-readable title for an entry or feed.
    * @param title the atom:title element
    */
-  void setTitleElement(Text title);
+  Entry setTitleElement(Text title);
   
   /**
    * Sets the value of the title as @type="text"
@@ -734,7 +734,7 @@
    * modifications necessarily result in a changed atom:updated value.
    * @param updated the atom:updated element.
    */
-  void setUpdatedElement(DateTime updated);
+  Entry setUpdatedElement(DateTime updated);
   
   /**
    * Return atom:updated
@@ -806,13 +806,13 @@
    * Sets this entries Atom Publishing Protocol control element
    * @param control The app:contorl element
    */
-  void setControl(Control control);
+  Entry setControl(Control control);
   
   /**
    * Sets whether or not this entry is a draft
    * @param draft true if this entry should be marked as a draft
    */
-  void setDraft(boolean draft);
+  Entry setDraft(boolean draft);
   
   /**
    * Returns true if this entry is a draft

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ExtensibleElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ExtensibleElement.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ExtensibleElement.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ExtensibleElement.java Tue Dec  4 15:23:33 2007
@@ -60,12 +60,12 @@
    * Adds an individual extension element
    * @param extension An extension element to add
    */
-  void addExtension(Element extension);
+  <T extends ExtensibleElement>T addExtension(Element extension);
 
   /**
    * Adds an individual extension element before the specified element 
    */
-  void addExtension(Element extension, Element before);
+  <T extends ExtensibleElement>T addExtension(Element extension, Element before);
   
   /**
    * Adds an individual extension element

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ExtensibleElementWrapper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ExtensibleElementWrapper.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ExtensibleElementWrapper.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ExtensibleElementWrapper.java Tue Dec  4 15:23:33 2007
@@ -43,8 +43,9 @@
     return (ExtensibleElement) getInternal();
   }
   
-  public void addExtension(Element extension) {
+  public <T extends ExtensibleElement>T addExtension(Element extension) {
     getExtInternal().addExtension(extension);
+    return (T)this;
   }
 
   @SuppressWarnings("unchecked")
@@ -98,12 +99,14 @@
     return getExtInternal().getMustPreserveWhitespace();
   }
 
-  public void setMustPreserveWhitespace(boolean preserve) {
+  public <T extends Element>T setMustPreserveWhitespace(boolean preserve) {
     getExtInternal().setMustPreserveWhitespace(preserve);
+    return (T)this;
   }
 
-  public void addExtension(Element extension, Element before) {
+  public <T extends ExtensibleElement>T addExtension(Element extension, Element before) {
     getExtInternal().addExtension(extension,before);
+    return (T)this;
   }
 
   @SuppressWarnings("unchecked")

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Feed.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Feed.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Feed.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Feed.java Tue Dec  4 15:23:33 2007
@@ -20,6 +20,8 @@
 import java.util.Comparator;
 import java.util.List;
 
+import org.apache.abdera.i18n.iri.IRISyntaxException;
+
 /**
  * <p>Represents an Atom Feed Element</p>
  * 
@@ -107,7 +109,7 @@
    * Adds a new Entry to the <i>end</i> of the Feeds collection of entries
    * @param entry Add an entry 
    */
-  void addEntry(Entry entry);
+  Feed addEntry(Entry entry);
 
   /**
    * Adds a new Entry to the <i>end</i> of the Feeds collection of entries
@@ -119,7 +121,7 @@
    * Adds a new Entry to the <i>start</i> of the Feeds collection of entries
    * @param entry An atom:entry to insert
    */
-  void insertEntry(Entry entry);
+  Feed insertEntry(Entry entry);
 
   /**
    * Adds a new Entry to the <i>start</i> of the Feeds collection of entries
@@ -137,18 +139,18 @@
    * Sorts entries by the atom:updated property
    * @param new_first If true, entries with newer atom:updated values will come first
    */
-  void sortEntriesByUpdated(boolean new_first);
+  Feed sortEntriesByUpdated(boolean new_first);
   
   /**
    * Sorts entries by the app:edited property. if app:edited is null, use app:updated
    */
-  void sortEntriesByEdited(boolean new_first);
+  Feed sortEntriesByEdited(boolean new_first);
   
   /**
    * Sorts entries using the given comparator
    * @param comparator Sort the entries using the comparator
    */
-  void sortEntries(Comparator<Entry> comparator);
+  Feed sortEntries(Comparator<Entry> comparator);
   
   /**
    * Retrieves the first entry in the feed with the given atom:id value

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Generator.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Generator.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Generator.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Generator.java Tue Dec  4 15:23:33 2007
@@ -18,6 +18,7 @@
 package org.apache.abdera.model;
 
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.iri.IRISyntaxException;
 
 /**
  * <p>Identifies the software implementation that produced the Atom feed.</p>
@@ -69,7 +70,7 @@
    * @param uri The URI attribute value
    * @throws IRISyntaxException if the uri is malformed
    */
-  void setUri(String uri);
+  Generator setUri(String uri);
   
   /**
    * The atom:generator element MAY have a "version" attribute that
@@ -83,6 +84,6 @@
    * indicates the version of the generating agent.
    * @param version The version attribute
    */
-  void setVersion(String version);
+  Generator setVersion(String version);
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/IRIElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/IRIElement.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/IRIElement.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/IRIElement.java Tue Dec  4 15:23:33 2007
@@ -18,6 +18,7 @@
 package org.apache.abdera.model;
 
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.iri.IRISyntaxException;
 
 /**
  * <p>The IRI interface provides a common base for a set of feed and 
@@ -38,14 +39,14 @@
    * @param iri The iri value
    * @throws IRISyntaxException  if the value is malformed
    */
-  void setValue(String iri);
+  IRIElement setValue(String iri);
   
   /**
    * Set the value of this element using the normalization as specified in RFC4287
    * @param iri A non-normalized IRI
    * @throws IRISyntaxException if the iri is malformed
    */
-  void setNormalizedValue(String iri);
+  IRIElement setNormalizedValue(String iri);
   
   /**
    * Returns the value of the element resolved against the current

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Link.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Link.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Link.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Link.java Tue Dec  4 15:23:33 2007
@@ -105,7 +105,7 @@
    * @param href The href IRI
    * @throws IRISyntaxException if the href is malformed
    */
-  void setHref(String href);
+  Link setHref(String href);
   
   /**
    * <p>RFC4287: atom:link elements MAY have a "rel" attribute that indicates the link
@@ -141,7 +141,7 @@
    * behavioral requirements on Atom Processors.</p>
    * @param rel The rel attribute value
    */
-  void setRel(String rel);
+  Link setRel(String rel);
   
   /**
    * RFC4287: On the link element, the "type" attribute's value is an advisory
@@ -167,7 +167,7 @@
    * @param type The link type
    * @throws MimeTypeParseException if the type is malformed
    */
-  void setMimeType(String type);
+  Link setMimeType(String type);
   
   /**
    * RFC4287: The "hreflang" attribute's content describes the language of the
@@ -187,7 +187,7 @@
    * language tag [RFC3066].
    * @param lang The hreflang value
    */
-  void setHrefLang(String lang);
+  Link setHrefLang(String lang);
   
   /**
    * RFC4287: The "title" attribute conveys human-readable information about the
@@ -207,7 +207,7 @@
    * MAY have a title attribute.
    * @param title The title attribute
    */
-  void setTitle(String title);
+  Link setTitle(String title);
   
   /**
    * RFC4287: The "length" attribute indicates an advisory length of the linked
@@ -231,6 +231,6 @@
    * attribute.
    * @param length The length attribute value
    */
-  void setLength(long length);
+  Link setLength(long length);
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Person.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Person.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Person.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Person.java Tue Dec  4 15:23:33 2007
@@ -18,6 +18,7 @@
 package org.apache.abdera.model;
 
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.iri.IRISyntaxException;
 
 /**
  * <p>An Atom Person Construct</p>
@@ -54,7 +55,7 @@
    * constructs MUST contain exactly one "atom:name" element.
    * @param element The atom:name element
    */
-  void setNameElement(Element element);
+  Person setNameElement(Element element);
   
   /**
    * The "atom:name" element's content conveys a human-readable name for
@@ -89,7 +90,7 @@
    * MUST conform to the "addr-spec" production in [RFC2822].
    * @param element The atom:email element
    */
-  void setEmailElement(Element element);
+  Person setEmailElement(Element element);
   
   /**
    * The "atom:email" element's content conveys an e-mail address
@@ -126,7 +127,7 @@
    * construct MUST be an IRI reference [RFC3987].
    * @param uri The atom:uri element
    */
-  void setUriElement(IRIElement uri);
+  Person setUriElement(IRIElement uri);
   
   /**
    * The "atom:uri" element's content conveys an IRI associated with the

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/PersonWrapper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/PersonWrapper.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/PersonWrapper.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/PersonWrapper.java Tue Dec  4 15:23:33 2007
@@ -80,12 +80,13 @@
     }
   }
 
-  public void setEmailElement(Element element) {
+  public Person setEmailElement(Element element) {
     ExtensibleElement internal = getExtInternal();
     Element el = getEmailElement();
     if (el != null) el.discard();
     if (element != null) 
       internal.addExtension(element);
+    return this;
   }
 
   public Element setName(String name) {
@@ -102,12 +103,13 @@
     }
   }
 
-  public void setNameElement(Element element) {
+  public Person setNameElement(Element element) {
     ExtensibleElement internal = getExtInternal();
     Element el = getNameElement();
     if (el != null) el.discard();
     if (element != null) 
       internal.addExtension(element);
+    return this;
   }
 
   public IRIElement setUri(String uri) {
@@ -124,12 +126,13 @@
     }
   }
 
-  public void setUriElement(IRIElement element) {
+  public Person setUriElement(IRIElement element) {
     ExtensibleElement internal = getExtInternal();
     Element el = getUriElement();
     if (el != null) el.discard();
     if (element != null) 
       internal.addExtension(element);
+    return this;
   }
 
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ProcessingInstruction.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ProcessingInstruction.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ProcessingInstruction.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ProcessingInstruction.java Tue Dec  4 15:23:33 2007
@@ -50,7 +50,7 @@
   /**
    * The PI target
    */
-  void setTarget(String target);
+  <T extends ProcessingInstruction>T setTarget(String target);
   
   /**
    * The PI text
@@ -60,6 +60,6 @@
   /**
    * The PI text
    */
-  void setText(String text);
+  <T extends ProcessingInstruction>T setText(String text);
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Service.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Service.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Service.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Service.java Tue Dec  4 15:23:33 2007
@@ -61,7 +61,7 @@
    * Add an individual workspace
    * @param workspace a app:workspace element
    */
-  void addWorkspace(Workspace workspace);
+  Service addWorkspace(Workspace workspace);
 
   /**
    * Add an individual workspace

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Source.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Source.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Source.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Source.java Tue Dec  4 15:23:33 2007
@@ -81,7 +81,7 @@
    * Adds an individual author to the entry
    * @param person an atom:author element
    */
-  void addAuthor(Person person);
+  <T extends Source>T addAuthor(Person person);
   
   /**
    * Adds an author
@@ -118,7 +118,7 @@
    * Adds an individual category to the entry
    * @param category A atom:category element
    */
-  void addCategory(Category category);
+  <T extends Source>T addCategory(Category category);
 
   /**
    * Adds a category to the feed
@@ -147,7 +147,7 @@
    * Adds an individual contributor to this entry
    * @param person a atom:contributor element
    */
-  void addContributor(Person person);
+  <T extends Source>T addContributor(Person person);
   
   /**
    * Adds a contributor
@@ -178,7 +178,7 @@
    * agent used to generate a feed, for debugging and other purposes.
    * @param generator A atom:generator element
    */
-  void setGenerator(Generator generator);
+  <T extends Source>T setGenerator(Generator generator);
 
   /**
    * RFC4287: The "atom:generator" element's content identifies the 
@@ -213,7 +213,7 @@
    *  presentation at a small size.
    *  @param iri The atom:icon element
    */
-  void setIconElement(IRIElement iri);
+  <T extends Source>T setIconElement(IRIElement iri);
   
   /** 
    * RFC4287: The "atom:icon" element's content is an IRI reference 
@@ -249,7 +249,7 @@
    * identifier for an entry or feed.
    * @param id A atom:id element
    */
-  void setIdElement(IRIElement id);
+  <T extends Source>T setIdElement(IRIElement id);
   
   /**
    * Returns the universally unique identifier for this feed
@@ -304,7 +304,7 @@
    * Adds an individual link to the entry
    * @param link A atom:link element
    */
-  void addLink(Link link);
+  <T extends Source>T addLink(Link link);
   
   /**
    * Adds an individual link element
@@ -349,7 +349,7 @@
    * The image SHOULD have an aspect ratio of 2 (horizontal) to 1 (vertical).
    * @param iri The atom:logo element
    */
-  void setLogoElement(IRIElement iri);
+  <T extends Source>T setLogoElement(IRIElement iri);
   
   /**
    * RFC4287: The "atom:logo" element's content is an IRI reference [RFC3987] 
@@ -389,7 +389,7 @@
    * 
    * @param text The atom:rights element
    */
-  void setRightsElement(Text text);
+  <T extends Source>T setRightsElement(Text text);
   
   /**
    * Sets the value of the rights as @type="text"
@@ -460,7 +460,7 @@
    * 
    * @param text A atom:subtitle element
    */  
-  void setSubtitleElement(Text text);
+  <T extends Source>T setSubtitleElement(Text text);
   
   /**
    * Sets the value of the subtitle as @type="text"
@@ -523,7 +523,7 @@
    * human-readable title for an entry or feed.
    * @param text The atom:title element
    */
-  void setTitleElement(Text text);
+  <T extends Source>T setTitleElement(Text text);
   
   /**
    * Sets the value of the title as @type="text"
@@ -589,7 +589,7 @@
    * modifications necessarily result in a changed atom:updated value.
    * @param dateTime A atom:updated element
    */
-  void setUpdatedElement(DateTime dateTime);
+  <T extends Source>T setUpdatedElement(DateTime dateTime);
   
   /**
    * Return the atom:updated value
@@ -680,7 +680,7 @@
    * Set the app:collection element
    * @param collection An app:collection element
    */
-  void setCollection(Collection collection);
+  <T extends Source>T setCollection(Collection collection);
   
   /**
    * Convert the Source element into an empty Feed element

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Text.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Text.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Text.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Text.java Tue Dec  4 15:23:33 2007
@@ -96,7 +96,7 @@
    * Set the Text.Type
    * @param type The Text.Type
    */
-  void setTextType(Type type);
+  Text setTextType(Type type);
   
   /**
    * Return the text value element
@@ -108,7 +108,7 @@
    * Set the text value element
    * @param value The xhtml:div
    */
-  void setValueElement(Div value);
+  Text setValueElement(Div value);
   
   /**
    * Return the text value
@@ -120,7 +120,7 @@
    * Set the text value
    * @param value The text value
    */
-  void setValue(String value);
+  Text setValue(String value);
   
   /**
    * Return the wrapped value
@@ -132,6 +132,6 @@
    * Set the wrapped value
    * @param wrappedValue The text value wrapped in a xhtml:div
    */
-  void setWrappedValue(String wrappedValue);
+  Text setWrappedValue(String wrappedValue);
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Workspace.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Workspace.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Workspace.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Workspace.java Tue Dec  4 15:23:33 2007
@@ -21,6 +21,8 @@
 
 import javax.activation.MimeType;
 
+import org.apache.abdera.i18n.iri.IRISyntaxException;
+
 /**
  * <p>An Atom Publishing Protocol Introspection Document workspace element.</p>
  * 
@@ -94,7 +96,7 @@
    * Adds an individual collection to this workspace
    * @param collection The collection to add
    */
-  void addCollection(Collection collection);
+  Workspace addCollection(Collection collection);
 
   /**
    * Adds an individual collection to this workspace

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/Parser.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/Parser.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/Parser.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/Parser.java Tue Dec  4 15:23:33 2007
@@ -199,6 +199,6 @@
    * copies the specified options.
    * @param options The Parser Options to use as the default
    */
-  void setDefaultParserOptions(ParserOptions options);
+  Parser setDefaultParserOptions(ParserOptions options);
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/ParserOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/ParserOptions.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/ParserOptions.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/ParserOptions.java Tue Dec  4 15:23:33 2007
@@ -40,7 +40,7 @@
   /**
    * Sets the factory the parser should use
    */
-  void setFactory(Factory factory);
+  ParserOptions setFactory(Factory factory);
   
   /**
    * Returns the default character set to use for the parsed document
@@ -50,7 +50,7 @@
   /**
    * Sets the character set to use for the parsed document
    */
-  void setCharset(String charset);
+  ParserOptions setCharset(String charset);
   
   /**
    * Returns the Parse Filter.  The parse filter is a set of XML QNames that
@@ -66,7 +66,7 @@
    * parse all elements in the document.  I the filter is not null, the parser
    * will only pay attention to elements whose QName's appear in the filter list.
    */
-  void setParseFilter(ParseFilter parseFilter);
+  ParserOptions setParseFilter(ParseFilter parseFilter);
   
   /**
    * Returns true if the parser should attempt to automatically detect the 
@@ -79,7 +79,7 @@
    * encoding from the stream by checking for the byte order mark or checking
    * the XML prolog.
    */
-  void setAutodetectCharset(boolean detect);
+  ParserOptions setAutodetectCharset(boolean detect);
   
   /**
    * If false, the parser will trim leading and trailing whitespace in element
@@ -91,7 +91,7 @@
    * If false, the parser will trim leading and trailing whitespace in element
    * and attribute values unless there is an in-scope xml:space="preserve".
    */
-  void setMustPreserveWhitespace(boolean preserve);
+  ParserOptions setMustPreserveWhitespace(boolean preserve);
   
   /**
    * If true, the parser will attempt to silently filter out invalid XML
@@ -103,7 +103,7 @@
    * If true, the parser will attempt to silently filter out invalid XML
    * characters appearing within the XML document
    */
-  void setFilterRestrictedCharacters(boolean filter);
+  ParserOptions setFilterRestrictedCharacters(boolean filter);
   
   /**
    * If getFilterRestrictedCharacters is true, restricted characters will
@@ -115,7 +115,7 @@
    * If getFilterRestrictedCharacters is true, restricted characters will
    * be replaced with the specified character
    */
-  void setFilterRestrictedCharacterReplacement(char replacement);
+  ParserOptions setFilterRestrictedCharacterReplacement(char replacement);
   
   /**
    * When parsing an InputStream that contains compressed data, use these
@@ -129,14 +129,14 @@
    * codecs to decompress the stream. Only used when parsing an InputStream.
    * Ignored when parsing a Reader
    */
-  void setCompressionCodecs(CompressionCodec... codecs);
+  ParserOptions setCompressionCodecs(CompressionCodec... codecs);
   
   /**
    * Register a named entity. This provides an escape clause for when 
    * feeds use entities that are not supported in XML without a DTD decl.
    * By default, all of the (X)HTML entities are preregistered
    */
-  void registerEntity(String name, String value);
+  ParserOptions registerEntity(String name, String value);
 
   /**
    * Resolves a value for a named entity. This provides an escape clause for when 
@@ -148,7 +148,7 @@
   /**
    * True if undeclared named entities should be resolved.
    */
-  void setResolveEntities(boolean resolve);
+  ParserOptions setResolveEntities(boolean resolve);
 
   /**
    * True if undeclared named entities should be resolved.
@@ -158,7 +158,7 @@
   /**
    * True if QName-Alias mapping is enabled
    */
-  void setQNameAliasMappingEnabled(boolean enabled);
+  ParserOptions setQNameAliasMappingEnabled(boolean enabled);
   
   /**
    * True if QName-Alias mapping is enabled (default is false)
@@ -173,6 +173,6 @@
   /**
    * Set the QName-Alias Mapping
    */
-  void setQNameAliasMap(Map<QName,QName> map);
+  ParserOptions setQNameAliasMap(Map<QName,QName> map);
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java Tue Dec  4 15:23:33 2007
@@ -138,10 +138,11 @@
   /**
    * Registers an ExtensionFactory implementation.
    */
-  public void addExtensionFactory(ExtensionFactory factory) {
+  public AbderaConfiguration addExtensionFactory(ExtensionFactory factory) {
     List<ExtensionFactory> factories = getExtensionFactories();
     if (!factories.contains(factory))
       factories.add(factory);
+    return this;
   }
   
   /**
@@ -164,9 +165,10 @@
   /**
    * Registers a NamedWriter implementation
    */
-  public void addNamedWriter(NamedWriter writer) {
+  public AbderaConfiguration addNamedWriter(NamedWriter writer) {
     Map<String,NamedWriter> writers = getNamedWriters();
     writers.put(writer.getName(), writer);
+    return this;
   }
   
   /**
@@ -230,16 +232,18 @@
   /**
    * Registers a NamedParser implementation
    */
-  public void addNamedParser(NamedParser parser) {
+  public AbderaConfiguration addNamedParser(NamedParser parser) {
     Map<String,NamedParser> parsers = getNamedParsers();
     parsers.put(parser.getName(), parser);
+    return this;
   }
 
   /**
    * Registers a StreamWriter implementation
    */
-  public void addStreamWriter(Class<? extends StreamWriter> sw) {
+  public AbderaConfiguration addStreamWriter(Class<? extends StreamWriter> sw) {
     getStreamWriters().put(getName(sw), sw);
+    return this;
   }
   
   /**

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractExtensionFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractExtensionFactory.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractExtensionFactory.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractExtensionFactory.java Tue Dec  4 15:23:33 2007
@@ -82,15 +82,17 @@
   /**
    * Associate a MIME media type for the specific QName
    */
-  protected void addMimeType(QName qname, String mimetype) {
+  protected AbstractExtensionFactory addMimeType(QName qname, String mimetype) {
     mimetypes.put(qname, mimetype);
+    return this;
   }
   
   /**
    * Associate a QName with an implementation class
    */
-  protected void addImpl(QName qname, Class<? extends ElementWrapper> impl) {
+  protected AbstractExtensionFactory addImpl(QName qname, Class<? extends ElementWrapper> impl) {
     impls.put(qname, impl);
+    return this;
   }
   
   @SuppressWarnings("unchecked") 

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java Tue Dec  4 15:23:33 2007
@@ -157,7 +157,7 @@
   
   protected abstract ParserOptions initDefaultParserOptions();
 
-  public synchronized void setDefaultParserOptions(ParserOptions options) {
+  public synchronized Parser setDefaultParserOptions(ParserOptions options) {
     // Ok, we need to make a defensive copy of the options, since otherwise
     // the caller still has access to the object, which means our access to
     // it isn't certain to be thread safe.
@@ -167,6 +167,7 @@
         (options != null) ? 
           (ParserOptions) options.clone() : 
           initDefaultParserOptions();
+      return this;
     } catch (CloneNotSupportedException cnse) {
       // This shouldn't actually happen
       throw new RuntimeException(cnse);

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParserOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParserOptions.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParserOptions.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParserOptions.java Tue Dec  4 15:23:33 2007
@@ -72,68 +72,77 @@
     return factory;
   }
   
-  public void setFactory(Factory factory) {
+  public ParserOptions setFactory(Factory factory) {
     checkFactory(factory);
     this.factory = factory;
+    return this;
   }
 
   public String getCharset() {
     return charset;
   }
 
-  public void setCharset(String charset) {
+  public ParserOptions setCharset(String charset) {
     this.charset = charset;
+    return this;
   }
 
   public ParseFilter getParseFilter() {
     return parseFilter;
   }
-  public void setParseFilter(ParseFilter parseFilter) {
+  public ParserOptions setParseFilter(ParseFilter parseFilter) {
     this.parseFilter = parseFilter;
+    return this;
   }
   
   public boolean getAutodetectCharset() {
     return this.detect;
   }
   
-  public void setAutodetectCharset(boolean detect) {
+  public ParserOptions setAutodetectCharset(boolean detect) {
     this.detect = detect;
+    return this;
   }
   
   public boolean getMustPreserveWhitespace() {
     return preserve;
   }
   
-  public void setMustPreserveWhitespace(boolean preserve) {
+  public ParserOptions setMustPreserveWhitespace(boolean preserve) {
     this.preserve = preserve;
+    return this;
   }
   
   public boolean getFilterRestrictedCharacters() {
     return filterreserved;
   }
   
-  public void setFilterRestrictedCharacters(boolean filter) {
+  public ParserOptions setFilterRestrictedCharacters(boolean filter) {
     this.filterreserved = filter;
+    return this;
   }
   
   public char getFilterRestrictedCharacterReplacement() {
     return replacement;
   }
   
-  public void setFilterRestrictedCharacterReplacement(char replacement) {
+  public ParserOptions setFilterRestrictedCharacterReplacement(char replacement) {
     this.replacement = replacement;
+    return this;
   }
   
   public CompressionCodec[] getCompressionCodecs() {
     return codecs;
   }
   
-  public void setCompressionCodecs(CompressionCodec... codecs) {
+  public ParserOptions setCompressionCodecs(CompressionCodec... codecs) {
     this.codecs = codecs;
+    return this;
   }
   
-  public void registerEntity(String name, String value) {
+  public ParserOptions registerEntity(String name, String value) {
     entities.put(name, value);
+    return this;
   }
 
   private void initDefaultEntities() {
@@ -395,8 +404,9 @@
     return resolveentities ? entities.get(name.toLowerCase()) : null;
   }
   
-  public void setResolveEntities(boolean resolve) {
+  public ParserOptions setResolveEntities(boolean resolve) {
     this.resolveentities = resolve;
+    return this;
   }
   
   public boolean getResolveEntities() {
@@ -407,15 +417,17 @@
     return aliases;
   }
   
-  public void setQNameAliasMap(Map<QName,QName> map) {
+  public ParserOptions setQNameAliasMap(Map<QName,QName> map) {
     this.aliases = map;
+    return this;
   }
   
   public boolean isQNameAliasMappingEnabled() {
     return qnamealiasing;
   }
   
-  public void setQNameAliasMappingEnabled(boolean enabled) {
+  public ParserOptions setQNameAliasMappingEnabled(boolean enabled) {
     this.qnamealiasing = enabled;
+    return this;
   }
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriter.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriter.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriter.java Tue Dec  4 15:23:33 2007
@@ -53,7 +53,7 @@
 
   protected abstract WriterOptions initDefaultWriterOptions();
   
-  public synchronized void setDefaultWriterOptions(WriterOptions options) {
+  public synchronized Writer setDefaultWriterOptions(WriterOptions options) {
     // Ok, we need to make a defensive copy of the options, since otherwise
     // the caller still has access to the object, which means our access to
     // it isn't certain to be thread safe.
@@ -67,6 +67,7 @@
       // This shouldn't actually happen
       throw new RuntimeException(cnse);
     }
+    return this;
   }
 
   public Object write(Base base) throws IOException {

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriterOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriterOptions.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriterOptions.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriterOptions.java Tue Dec  4 15:23:33 2007
@@ -36,24 +36,27 @@
     return codecs;
   }
 
-  public void setCompressionCodecs(CompressionCodec... codecs) {
+  public WriterOptions setCompressionCodecs(CompressionCodec... codecs) {
     this.codecs = codecs;
+    return this;
   }
 
   public String getCharset() {
     return charset;
   }
   
-  public void setCharset(String charset) {
+  public WriterOptions setCharset(String charset) {
     this.charset = charset;
+    return this;
   }
 
   public boolean getAutoClose() {
     return autoclose;
   }
 
-  public void setAutoClose(boolean autoclose) {
+  public WriterOptions setAutoClose(boolean autoclose) {
     this.autoclose = autoclose;
+    return this;
   }
   
   

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/filter/AbstractListParseFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/filter/AbstractListParseFilter.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/filter/AbstractListParseFilter.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/filter/AbstractListParseFilter.java Tue Dec  4 15:23:33 2007
@@ -43,15 +43,16 @@
     return super.clone();
   }
   
-  public void add(QName qname) {
+  public ListParseFilter add(QName qname) {
     if (!contains(qname)) qnames.add(qname);
+    return this;
   }
 
   public boolean contains(QName qname) {
     return qnames.contains(qname);
   }
 
-  public void add(QName parent, QName attribute) {
+  public ListParseFilter add(QName parent, QName attribute) {
     if (attributes.containsKey(parent)) {
       List<QName> attrs = attributes.get(parent);
       if (!attrs.contains(attribute)) attrs.add(attribute);
@@ -60,6 +61,7 @@
       attrs.add(attribute);
       attributes.put(parent, attrs);
     }
+    return this;
   }
 
   public boolean contains(QName qname, QName attribute) {

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/filter/AbstractParseFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/filter/AbstractParseFilter.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/filter/AbstractParseFilter.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/filter/AbstractParseFilter.java Tue Dec  4 15:23:33 2007
@@ -37,16 +37,19 @@
     return (flags & flag) == flag;
   }
   
-  public void setIgnoreComments(boolean ignore) {
+  public ParseFilter setIgnoreComments(boolean ignore) {
     toggle(ignore,COMMENTS);
+    return this;
   }
 
-  public void setIgnoreWhitespace(boolean ignore) {
+  public ParseFilter setIgnoreWhitespace(boolean ignore) {
     toggle(ignore,(byte)WHITESPACE);
+    return this;
   }
   
-  public void setIgnoreProcessingInstructions(boolean ignore) {
+  public ParseFilter setIgnoreProcessingInstructions(boolean ignore) {
     toggle(ignore,(byte)PI);
+    return this;
   }
   
   public boolean getIgnoreComments() {

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/Writer.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/Writer.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/Writer.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/Writer.java Tue Dec  4 15:23:33 2007
@@ -85,4 +85,5 @@
   
   WriterOptions getDefaultWriterOptions();
   
+  Writer setDefaultWriterOptions(WriterOptions options);
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/WriterOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/WriterOptions.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/WriterOptions.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/WriterOptions.java Tue Dec  4 15:23:33 2007
@@ -29,7 +29,7 @@
   /**
    * When writing, use the specified compression codecs
    */
-  void setCompressionCodecs(CompressionCodec... codecs);
+  WriterOptions setCompressionCodecs(CompressionCodec... codecs);
 
   Object clone() throws CloneNotSupportedException;
 
@@ -41,7 +41,7 @@
   /**
    * The character encoding to use for the output
    */
-  void setCharset(String charset);
+  WriterOptions setCharset(String charset);
 
   /**
    * True if the writer should close the output stream or writer when finished
@@ -51,5 +51,5 @@
   /**
    * True if the writer should close the output stream or writer when finished
    */
-  void setAutoClose(boolean autoclose);
+  WriterOptions setAutoClose(boolean autoclose);
 }

Modified: incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java (original)
+++ incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java Tue Dec  4 15:23:33 2007
@@ -51,6 +51,7 @@
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.Entry;
+import org.apache.abdera.model.ExtensibleElement;
 import org.apache.abdera.model.Feed;
 import org.apache.abdera.model.Generator;
 import org.apache.abdera.model.IRIElement;
@@ -168,7 +169,8 @@
       return null;
     }
     
-    public void addEntry(Entry entry) {
+    public Feed addEntry(Entry entry) {
+      return this;
     }
 
     public Entry addEntry() {
@@ -187,23 +189,28 @@
       return null;
     }
 
-    public void insertEntry(Entry entry) {
+    public Feed insertEntry(Entry entry) {
+      return this;
     }
 
     public Entry insertEntry() {
       return null;
     }
 
-    public void sortEntries(Comparator<Entry> comparator) {
+    public Feed sortEntries(Comparator<Entry> comparator) {
+      return null;
     }
 
-    public void sortEntriesByEdited(boolean new_first) {
+    public Feed sortEntriesByEdited(boolean new_first) {
+      return null;
     }
 
-    public void sortEntriesByUpdated(boolean new_first) {
+    public Feed sortEntriesByUpdated(boolean new_first) {
+      return null;
     }
 
-    public void addAuthor(Person person) {
+    public <T extends Source>T addAuthor(Person person) {
+      return (T)this;
     }
 
     public Person addAuthor(String name) {
@@ -214,7 +221,8 @@
       return null;
     }
 
-    public void addCategory(Category category) {
+    public <T extends Source>T addCategory(Category category) {
+      return (T)this;
     }
 
     public Category addCategory(String term) {
@@ -225,7 +233,8 @@
       return null;
     }
 
-    public void addContributor(Person person) {
+    public <T extends Source>T addContributor(Person person) {
+      return (T)this;
     }
 
     public Person addContributor(String name) {
@@ -236,7 +245,8 @@
       return null;
     }
 
-    public void addLink(Link link) {
+    public <T extends Source>T addLink(Link link) {
+      return (T)this;
     }
 
     public Link addLink(String href) {
@@ -403,10 +413,12 @@
       return null;
     }
 
-    public void setCollection(Collection collection) {
+    public <T extends Source>T setCollection(Collection collection) {
+      return (T)this;
     }
 
-    public void setGenerator(Generator generator) {
+    public <T extends Source>T setGenerator(Generator generator) {
+      return (T)this;
     }
 
     public Generator setGenerator(String iri, String version, String value) {
@@ -417,7 +429,8 @@
       return null;
     }
 
-    public void setIconElement(IRIElement iri) {
+    public <T extends Source>T setIconElement(IRIElement iri) {
+      return (T)this;
     }
 
     public IRIElement setId(String id) {
@@ -428,14 +441,16 @@
       return null;
     }
 
-    public void setIdElement(IRIElement id) {
+    public <T extends Source>T setIdElement(IRIElement id) {
+      return (T)this;
     }
 
     public IRIElement setLogo(String iri) {
       return null;
     }
 
-    public void setLogoElement(IRIElement iri) {
+    public <T extends Source>T setLogoElement(IRIElement iri) {
+      return (T)this;
     }
 
     public Text setRights(String value) {
@@ -458,7 +473,8 @@
       return null;
     }
 
-    public void setRightsElement(Text text) {
+    public <T extends Source>T setRightsElement(Text text) {
+      return (T)this;
     }
 
     public Text setSubtitle(String value) {
@@ -481,7 +497,8 @@
       return null;
     }
 
-    public void setSubtitleElement(Text text) {
+    public <T extends Source>T setSubtitleElement(Text text) {
+      return (T)this;
     }
 
     public Text setTitle(String value) {
@@ -504,7 +521,8 @@
       return null;
     }
 
-    public void setTitleElement(Text text) {
+    public <T extends Source>T setTitleElement(Text text) {
+      return (T)this;
     }
 
     public DateTime setUpdated(Date value) {
@@ -515,10 +533,12 @@
       return null;
     }
 
-    public void setUpdatedElement(DateTime dateTime) {
+    public <T extends Source>T setUpdatedElement(DateTime dateTime) {
+      return (T)this;
     }
 
-    public void addExtension(Element extension) {
+    public <T extends ExtensibleElement>T addExtension(Element extension) {
+      return (T)this;
     }
 
     public <T extends Element> T addExtension(QName qname) {
@@ -565,7 +585,8 @@
       return null;
     }
 
-    public void declareNS(String uri, String prefix) {
+    public Feed declareNS(String uri, String prefix) {
+      return null;
     }
 
     public void discard() {
@@ -659,37 +680,48 @@
       return null;
     }
 
-    public void removeAttribute(QName qname) {
+    public Feed removeAttribute(QName qname) {
+      return null;
     }
 
-    public void setAttributeValue(String name, String value) {
+    public Feed setAttributeValue(String name, String value) {
+      return null;
     }
 
-    public void setAttributeValue(QName qname, String value) {
+    public Feed setAttributeValue(QName qname, String value) {
+      return null;
     }
 
-    public void setBaseUri(IRI base) {
+    public Feed setBaseUri(IRI base) {
+      return null;
     }
 
-    public void setBaseUri(String base) {
+    public Feed setBaseUri(String base) {
+      return null;
     }
 
-    public void setLanguage(String language) {
+    public Feed setLanguage(String language) {
+      return null;
     }
 
-    public void setMustPreserveWhitespace(boolean preserve) {
+    public Feed setMustPreserveWhitespace(boolean preserve) {
+      return null;
     }
 
-    public void setParentElement(Element parent) {
+    public Feed setParentElement(Element parent) {
+      return null;
     }
 
-    public void setText(String text) {
+    public Feed setText(String text) {
+      return null;
     }
 
-    public void setText(DataHandler dataHandler) {
+    public Feed setText(DataHandler dataHandler) {
+      return null;
     }
 
-    public void addComment(String value) {
+    public Feed addComment(String value) {
+      return null;
     }
 
     public WriterOptions getDefaultWriterOptions() {
@@ -724,13 +756,17 @@
     public void writeTo(Writer writer) throws IOException {
     }
 
-    public void addExtension(Element extension, Element before) {}
+    public <T extends ExtensibleElement>T addExtension(Element extension, Element before) {
+      return (T)this;
+    }
 
     public <T extends Element> T addExtension(QName qname, QName before) {
       return null;
     }
 
-    public void complete() {}
+    public Feed complete() {
+      return null;
+    }
 
     public Iterator<Element> iterator() {
       return null;
@@ -746,7 +782,9 @@
     public void writeTo(String writer, Writer out, WriterOptions options)
         throws IOException {}
 
-    public void removeAttribute(String name) {}
+    public Feed removeAttribute(String name) {
+      return null;
+    }
     
   }
   
@@ -756,7 +794,8 @@
       return null;
     }
     
-    public void addAuthor(Person person) {
+    public Entry addAuthor(Person person) {
+      return this;
     }
 
     public Person addAuthor(String name) {
@@ -767,7 +806,8 @@
       return null;
     }
 
-    public void addCategory(Category category) {
+    public Entry addCategory(Category category) {
+      return this;
     }
 
     public Category addCategory(String term) {
@@ -778,7 +818,8 @@
       return null;
     }
 
-    public void addContributor(Person person) {
+    public Entry addContributor(Person person) {
+      return this;
     }
 
     public Person addContributor(String name) {
@@ -789,7 +830,8 @@
       return null;
     }
 
-    public void addLink(Link link) {
+    public Entry addLink(Link link) {
+      return this;
     }
 
     public Link addLink(String href) {
@@ -1060,13 +1102,16 @@
       return null;
     }
 
-    public void setContentElement(Content content) {
+    public Entry setContentElement(Content content) {
+      return this;
     }
 
-    public void setControl(Control control) {
+    public Entry setControl(Control control) {
+      return this;
     }
 
-    public void setDraft(boolean draft) {
+    public Entry setDraft(boolean draft) {
+      return this;
     }
 
     public DateTime setEdited(Date value) {
@@ -1088,7 +1133,8 @@
       return null;
     }
 
-    public void setIdElement(IRIElement id) {
+    public Entry setIdElement(IRIElement id) {
+      return this;
     }
 
     public DateTime setPublished(Date value) {
@@ -1099,7 +1145,8 @@
       return null;
     }
 
-    public void setPublishedElement(DateTime dateTime) {
+    public Entry setPublishedElement(DateTime dateTime) {
+      return this;
     }
 
     public Text setRights(String value) {
@@ -1122,10 +1169,12 @@
       return null;
     }
 
-    public void setRightsElement(Text text) {
+    public Entry setRightsElement(Text text) {
+      return this;
     }
 
-    public void setSource(Source source) {
+    public Entry setSource(Source source) {
+      return this;
     }
 
     public Text setSummary(String value) {
@@ -1148,7 +1197,8 @@
       return null;
     }
 
-    public void setSummaryElement(Text text) {
+    public Entry setSummaryElement(Text text) {
+      return this;
     }
 
     public Text setTitle(String value) {
@@ -1171,7 +1221,8 @@
       return null;
     }
 
-    public void setTitleElement(Text title) {
+    public Entry setTitleElement(Text title) {
+      return this;
     }
 
     public DateTime setUpdated(Date value) {
@@ -1182,10 +1233,12 @@
       return null;
     }
 
-    public void setUpdatedElement(DateTime updated) {
+    public Entry setUpdatedElement(DateTime updated) {
+      return this;
     }
 
-    public void addExtension(Element extension) {
+    public <T extends ExtensibleElement>T addExtension(Element extension) {
+      return (T)this;
     }
 
     public <T extends Element> T addExtension(QName qname) {
@@ -1232,7 +1285,8 @@
       return null;
     }
 
-    public void declareNS(String uri, String prefix) {
+    public Entry declareNS(String uri, String prefix) {
+      return null;
     }
 
     public void discard() {
@@ -1326,37 +1380,48 @@
       return null;
     }
 
-    public void removeAttribute(QName qname) {
+    public Entry removeAttribute(QName qname) {
+      return null;
     }
 
-    public void setAttributeValue(String name, String value) {
+    public Entry setAttributeValue(String name, String value) {
+      return null;
     }
 
-    public void setAttributeValue(QName qname, String value) {
+    public Entry setAttributeValue(QName qname, String value) {
+      return null;
     }
 
-    public void setBaseUri(IRI base) {
+    public Entry setBaseUri(IRI base) {
+      return null;
     }
 
-    public void setBaseUri(String base) {
+    public Entry setBaseUri(String base) {
+      return null;
     }
 
-    public void setLanguage(String language) {
+    public Entry setLanguage(String language) {
+      return null;
     }
 
-    public void setMustPreserveWhitespace(boolean preserve) {
+    public Entry setMustPreserveWhitespace(boolean preserve) {
+      return null;
     }
 
-    public void setParentElement(Element parent) {
+    public Entry setParentElement(Element parent) {
+      return null;
     }
 
-    public void setText(String text) {
+    public Entry setText(String text) {
+      return null;
     }
 
-    public void setText(DataHandler dataHandler) {
+    public Entry setText(DataHandler dataHandler) {
+      return null;
     }
 
-    public void addComment(String value) {
+    public Entry addComment(String value) {
+      return null;
     }
 
     public WriterOptions getDefaultWriterOptions() {
@@ -1391,13 +1456,17 @@
     public void writeTo(Writer writer) throws IOException {
     }
 
-    public void addExtension(Element extension, Element before) {}
+    public <T extends ExtensibleElement>T addExtension(Element extension, Element before) {
+      return (T)this;
+    }
 
     public <T extends Element> T addExtension(QName qname, QName before) {
       return null;
     }
 
-    public void complete() {}
+    public Entry complete() {
+      return null;
+    }
 
     public Iterator<Element> iterator() {
       return null;
@@ -1413,7 +1482,9 @@
     public void writeTo(String writer, Writer out, WriterOptions options)
         throws IOException {}
 
-    public void removeAttribute(String name) {}
+    public Entry removeAttribute(String name) {
+      return null;
+    }
     
   }
 }

Modified: incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/opensearch/Query.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/opensearch/Query.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/opensearch/Query.java (original)
+++ incubator/abdera/java/trunk/extensions/opensearch/src/main/java/org/apache/abdera/ext/opensearch/Query.java Tue Dec  4 15:23:33 2007
@@ -155,12 +155,13 @@
     return getInternal().getAttributeValue("language");
   }
   
-  public void setLanguage(String language) {
+  public <T extends Element>T setLanguage(String language) {
     if (language != null) {
       getInternal().setAttributeValue("language", language);
     } else {
       getInternal().removeAttribute(new QName("language"));
     }
+    return (T)this;
   }
   
   public String getInputEncoding() {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMAttribute.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMAttribute.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMAttribute.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMAttribute.java Tue Dec  4 15:23:33 2007
@@ -40,8 +40,9 @@
     return attr.getAttributeValue();
   }
   
-  public void setText(String text) {
+  public Attribute setText(String text) {
     attr.setAttributeValue(text);
+    return this;
   }
   
   public Factory getFactory() {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java Tue Dec  4 15:23:33 2007
@@ -90,9 +90,10 @@
     this.declareNamespace(ATOM_NS, "atom");
   }
   
-  public void addCategory(Category category) {
+  public Categories addCategory(Category category) {
     complete();
     addChild((OMElement)category);
+    return this;
   }
 
   public Category addCategory(String term) {
@@ -156,20 +157,22 @@
     return (value != null && value.equals(YES));
   }
 
-  public void setFixed(boolean fixed) {
+  public Categories setFixed(boolean fixed) {
     complete();
     if (fixed && !isFixed())
       setAttributeValue(FIXED, YES);
     else if (!fixed && isFixed())
       removeAttribute(FIXED);
+    return this;
   }
 
-  public void setScheme(String scheme) {
+  public Categories setScheme(String scheme) {
     complete();
     if (scheme != null)
       setAttributeValue(SCHEME, new IRI(scheme).toString());
     else 
       removeAttribute(SCHEME);
+    return this;
   }
   
   public IRI getHref()  {
@@ -180,12 +183,13 @@
     return _resolve(getResolvedBaseUri(), getHref());
   }
   
-  public void setHref(String href) {
+  public Categories setHref(String href) {
     complete();
     if (href != null)
       setAttributeValue(HREF, (new IRI(href)).toString());
     else 
       removeAttribute(HREF);
+    return this;
   }
 
   public boolean contains(

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java Tue Dec  4 15:23:33 2007
@@ -21,6 +21,7 @@
 
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.abdera.model.Category;
+import org.apache.abdera.model.Element;
 import org.apache.abdera.util.Constants;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
@@ -95,12 +96,13 @@
     return getAttributeValue(TERM);
   }
 
-  public void setTerm(String term) {
+  public Category setTerm(String term) {
     complete();
     if (term != null)
       setAttributeValue(TERM, term);
     else
       removeAttribute(TERM);
+    return this;
   }
 
   public IRI getScheme() {
@@ -108,24 +110,26 @@
     return (value != null) ? new IRI(value) : null;
   }
 
-  public void setScheme(String scheme) {
+  public Category setScheme(String scheme) {
     complete();
     if (scheme != null)
       setAttributeValue(SCHEME, new IRI(scheme).toString());
     else 
       removeAttribute(SCHEME);
+    return this;
   }
   
   public String getLabel() {
     return getAttributeValue(LABEL);
   }
 
-  public void setLabel(String label) {
+  public Category setLabel(String label) {
     complete();
     if (label != null)
       setAttributeValue(LABEL, label);
     else
       removeAttribute(LABEL);
+    return this;
   }
 
   public String getValue() {
@@ -135,7 +139,7 @@
   public void setValue(String value) {
     complete();
     if (value != null)
-      setText(value);
+      ((Element)this).setText(value);
     else
       _removeAllChildren();
   }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java Tue Dec  4 15:23:33 2007
@@ -137,12 +137,13 @@
     return _resolve(getResolvedBaseUri(), getHref());
   }
   
-  public void setHref(String href) {
+  public Collection setHref(String href) {
     complete();
     if (href != null)
       setAttributeValue(HREF, (new IRI(href).toString()));
     else 
       removeAttribute(HREF);
+    return this;
   }
   
   public String[] getAccept(){
@@ -164,11 +165,11 @@
     }
   }
 
-  public void setAccept(String mediaRange) {
-    setAccept(new String[] {mediaRange});
+  public Collection setAccept(String mediaRange) {
+    return setAccept(new String[] {mediaRange});
   }
   
-  public void setAccept(String... mediaRanges) {
+  public Collection setAccept(String... mediaRanges) {
     complete();
     if (mediaRanges != null && mediaRanges.length > 0) {
       _removeChildren(ACCEPT, true);
@@ -193,13 +194,14 @@
       _removeChildren(ACCEPT, true);
       _removeChildren(PRE_RFC_ACCEPT,true);
     }
+    return this;
   }
   
-  public void addAccepts(String mediaRange) {
-    addAccepts(new String[] {mediaRange});
+  public Collection addAccepts(String mediaRange) {
+    return addAccepts(new String[] {mediaRange});
   }
   
-  public void addAccepts(String... mediaRanges) {
+  public Collection addAccepts(String... mediaRanges) {
     complete();
     if (mediaRanges != null) {
       for (String type : mediaRanges) {
@@ -210,18 +212,19 @@
         }
       }
     }
+    return this;
   }
   
-  public void addAcceptsEntry() {
-    addAccepts("application/atom+xml;type=entry");
+  public Collection addAcceptsEntry() {
+    return addAccepts("application/atom+xml;type=entry");
   }
   
-  public void setAcceptsEntry() {
-    setAccept("application/atom+xml;type=entry");
+  public Collection setAcceptsEntry() {
+    return setAccept("application/atom+xml;type=entry");
   }
   
-  public void setAcceptsNothing() {
-    setAccept("");
+  public Collection setAcceptsNothing() {
+    return setAccept("");
   }
   
   public boolean acceptsEntry() {
@@ -250,9 +253,10 @@
     return ((FOMFactory)factory).newCategories(this);
   }
   
-  public void addCategories(Categories categories) {
+  public Collection addCategories(Categories categories) {
     complete();
     addChild((OMElement)categories);
+    return this;
   }
 
   public Categories addCategories(

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java Tue Dec  4 15:23:33 2007
@@ -42,8 +42,9 @@
     return super.getValue();
   }
   
-  public void setText(String text) {
+  public Comment setText(String text) {
     super.setValue(text);
+    return this;
   }
   
   public <T extends Base>T getParentElement() {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java Tue Dec  4 15:23:33 2007
@@ -35,6 +35,7 @@
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMXMLParserWrapper;
 
 @SuppressWarnings("unchecked")
@@ -117,9 +118,10 @@
     return type;
   }
 
-  public void setContentType(Type type) {
+  public Content setContentType(Type type) {
     complete();
     init(type);
+    return this;
   }
   
   public <T extends Element> T getValueElement() {
@@ -127,7 +129,7 @@
     return (T)factory.getElementWrapper((Element)this.getFirstElement());
   }
 
-  public <T extends Element> void setValueElement(T value) {
+  public <T extends Element> Content setValueElement(T value) {
     complete();
     if (value != null) {
       if (this.getFirstElement() != null)
@@ -154,6 +156,7 @@
     } else {
       _removeAllChildren();
     }
+    return this;
   }
 
   public MimeType getMimeType() {
@@ -167,7 +170,7 @@
     return type;
   }
   
-  public void setMimeType(String type) {
+  public Content setMimeType(String type) {
     complete();
     try {
       if (type != null)
@@ -177,6 +180,7 @@
     } catch (javax.activation.MimeTypeParseException e) {
       throw new org.apache.abdera.util.MimeTypeParseException(e);
     }      
+    return this;
   }
 
   public IRI getSrc() {
@@ -187,13 +191,13 @@
     return _resolve(getResolvedBaseUri(), getSrc());
   }
   
-  public void setSrc(String src) {
+  public Content setSrc(String src) {
     complete();
     if (src != null)
       setAttributeValue(SRC, (new IRI(src)).toString());
     else 
       removeAttribute(SRC);
-
+    return this;
   }
 
   public DataHandler getDataHandler() {
@@ -215,7 +219,7 @@
     return dh;
   }
   
-  public void setDataHandler(DataHandler dataHandler) {
+  public Content setDataHandler(DataHandler dataHandler) {
     complete();
     if (!Type.MEDIA.equals(type)) throw new IllegalArgumentException();
     if (dataHandler.getContentType() != null) {
@@ -225,6 +229,7 @@
     }
     _removeAllChildren();
     addChild(factory.createOMText(dataHandler, true));
+    return this;
   }
   
   public String getValue() {
@@ -245,22 +250,37 @@
     return val;
   }
 
-  public void setText(String value) {
+  public <T extends Element>T setText(Content.Type type, String value) {
     complete();
-    init(Content.Type.TEXT);
-    super.setText(value);
+    init(type);
+    if (value != null) {
+      OMNode child = this.getFirstOMChild();
+      while (child != null) {
+          if (child.getType() == OMNode.TEXT_NODE) {
+              child.detach();
+          }
+          child = child.getNextOMSibling();
+      }
+      getOMFactory().createOMText(this, value);
+    } else 
+      _removeAllChildren();
+    return (T)this;
+  }  
+  
+  public <T extends Element>T setText(String value) {
+    return (T)setText(Content.Type.TEXT,value);
   }
   
-  public void setValue(String value) {
+  public Content setValue(String value) {
     complete();
     if (value != null) removeAttribute(SRC);
     if (value != null) {
       if (Type.TEXT.equals(type)) {
         _removeAllChildren();
-        super.setText(value); 
+        setText(type,value); 
       } else if (Type.HTML.equals(type)) {
         _removeAllChildren();
-        super.setText(value);
+        setText(type,value);
       } else if (Type.XHTML.equals(type)) {
         IRI baseUri = null;
         Element element = null;
@@ -286,7 +306,7 @@
         } catch (Exception e) {}
       } else if (Type.MEDIA.equals(type)) {
         _removeAllChildren();
-        super.setText(value);
+        setText(type,value);
         try {
           if (getMimeType() == null)
             setMimeType("text/plain");
@@ -295,6 +315,7 @@
     } else {
       _removeAllChildren();
     }
+    return this;
   }
 
   public String getWrappedValue() {
@@ -305,7 +326,7 @@
     }
   }
 
-  public void setWrappedValue(String wrappedValue) {
+  public Content setWrappedValue(String wrappedValue) {
     complete();
     if (Type.XHTML.equals(type)) {
       IRI baseUri = null;
@@ -317,8 +338,9 @@
       if (element != null && element instanceof Div)
         setValueElement((Div)element);
     } else {
-      setText(wrappedValue);
+      ((Element)this).setText(wrappedValue);
     }
+    return this;
   }
 
   @Override

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMControl.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMControl.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMControl.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMControl.java Tue Dec  4 15:23:33 2007
@@ -82,16 +82,18 @@
     return (value != null && YES.equalsIgnoreCase(value));
   }
 
-  public void setDraft(boolean draft) {
+  public Control setDraft(boolean draft) {
     complete();
     _removeChildren(PRE_RFC_DRAFT, true);
     _setElementValue(DRAFT, (draft) ? YES:NO);
+    return this;
   }
   
-  public void unsetDraft() {
+  public Control unsetDraft() {
     complete();
     _removeChildren(PRE_RFC_DRAFT, true);
     _removeChildren(DRAFT, true);
+    return this;
   }
 
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDateTime.java Tue Dec  4 15:23:33 2007
@@ -24,6 +24,7 @@
 
 import org.apache.abdera.model.AtomDate;
 import org.apache.abdera.model.DateTime;
+import org.apache.abdera.model.Element;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -102,46 +103,51 @@
     return value;
   }
 
-  public void setValue(AtomDate dateTime) {
+  public DateTime setValue(AtomDate dateTime) {
     complete();
     value = null;
     if (dateTime != null)
-      setText(dateTime.getValue());
+      ((Element)this).setText(dateTime.getValue());
     else 
       _removeAllChildren();
+    return this;
   }
 
-  public void setDate(Date date) {
+  public DateTime setDate(Date date) {
     complete();
     value = null;
     if (date != null)
-      setText(AtomDate.valueOf(date).getValue());
+      ((Element)this).setText(AtomDate.valueOf(date).getValue());
     else 
       _removeAllChildren();
+    return this;
   }
 
-  public void setCalendar(Calendar date) {
+  public DateTime setCalendar(Calendar date) {
     complete();
     value = null;
     if (date != null)
-      setText(AtomDate.valueOf(date).getValue());
+      ((Element)this).setText(AtomDate.valueOf(date).getValue());
     else 
       _removeAllChildren();
+    return this;
   }
 
-  public void setTime(long date) {
+  public DateTime setTime(long date) {
     complete();
     value = null;
-    setText(AtomDate.valueOf(date).getValue());
+    ((Element)this).setText(AtomDate.valueOf(date).getValue());
+    return this;
   }
 
-  public void setString(String date) {
+  public DateTime setString(String date) {
     complete();
     value = null;
     if (date != null)
-      setText(AtomDate.valueOf(date).getValue());
+      ((Element)this).setText(AtomDate.valueOf(date).getValue());
     else 
       _removeAllChildren();
+    return this;
   }
 
   public Date getDate() {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDiv.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDiv.java?rev=601147&r1=601146&r2=601147&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDiv.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDiv.java Tue Dec  4 15:23:33 2007
@@ -88,23 +88,25 @@
     return getAttributeValue(ATITLE);
   }
 
-  public void setId(String id) {
+  public Div setId(String id) {
     complete();
     if (id != null)
       setAttributeValue(AID, id);
     else 
       removeAttribute(AID);
+    return this;
   }
   
-  public void setTitle(String title) {
+  public Div setTitle(String title) {
     complete();
     if (title != null)
       setAttributeValue(ATITLE, title);
     else 
       removeAttribute(ATITLE);
+    return this;
   }
   
-  public void setXhtmlClass(String[] classes) {
+  public Div setXhtmlClass(String[] classes) {
     complete();
     if (classes != null) {
       StringBuffer val = new StringBuffer();
@@ -115,6 +117,7 @@
       }
       setAttributeValue(CLASS, val.toString());
     } else removeAttribute(CLASS);
+    return this;
   }
 
   public String getValue() {



Mime
View raw message