abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r420662 [1/2] - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/factory/ parser/src/main/java/org/apache/abdera/parser/stax/ parser/src/test/java/org/apache/abdera/test/parser/stax/
Date Mon, 10 Jul 2006 23:42:23 GMT
Author: jmsnell
Date: Mon Jul 10 16:42:23 2006
New Revision: 420662

URL: http://svn.apache.org/viewvc?rev=420662&view=rev
Log:
Factory interface simplifications
Removed most of the convenience methods that are already available via the other interfaces
Simplified the alternatives impl

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java?rev=420662&r1=420661&r2=420662&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/factory/Factory.java Mon Jul 10 16:42:23 2006
@@ -17,16 +17,9 @@
 */
 package org.apache.abdera.factory;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.activation.DataHandler;
 import javax.activation.MimeType;
 import javax.xml.namespace.QName;
 
-import org.apache.abdera.model.AtomDate;
 import org.apache.abdera.model.Base;
 import org.apache.abdera.model.Category;
 import org.apache.abdera.model.Collection;
@@ -37,7 +30,6 @@
 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.Generator;
 import org.apache.abdera.model.IRI;
@@ -97,110 +89,26 @@
   
   Category newCategory(Element parent);
   
-  Category newCategory(String term);
-  
-  Category newCategory(String term, Element parent);
-  
-  Category newCategory(String term, URI scheme, String label);
-  
-  Category newCategory(String term, URI scheme, String label, Element parent);
-
   Content newContent();
   
-  Content newContent(String value);
-  
   Content newContent(Content.Type type);
   
   Content newContent(Content.Type type, Element parent);
   
-  Content newContent(String value, Content.Type type);
-  
-  Content newContent(Element value, Content.Type type);
-
-  Content newContent(String value, Content.Type type, Element parent);
-  
-  Content newContent(Element value, Content.Type type, Element parent);  
-  
   Content newContent(MimeType mediaType);
   
   Content newContent(MimeType mediaType, Element parent);
   
-  Content newContent(URI src, MimeType mediaType);
-  
-  Content newContent(URI src, MimeType mediaType, Element parent);
-  
-  Content newContent(Element element, MimeType mediaType);
-  
-  Content newContent(Element element, MimeType mediaType, Element parent);
-  
-  Content newContent(DataHandler dataHandler, MimeType mediatype);
-  
-  Content newContent(DataHandler dataHandler, MimeType mediaType, Element parent);
-
-  Content newContent(String value, MimeType mediatype);
-  
-  Content newContent(String value, MimeType mediaType, Element parent);
-  
   DateTime newPublished();
   
-  DateTime newPublished(AtomDate dateTime);
-  
-  DateTime newPublished(Date date);
-  
-  DateTime newPublished(String date);
-  
-  DateTime newPublished(Calendar date);
-  
-  DateTime newPublished(long date);  
-  
   DateTime newPublished(Element parent);
   
-  DateTime newPublished(AtomDate dateTime, Element parent);
-  
-  DateTime newPublished(Date date, Element parent);
-  
-  DateTime newPublished(String date, Element parent);
-  
-  DateTime newPublished(Calendar date, Element parent);
-  
-  DateTime newPublished(long date, Element parent);  
-  
   DateTime newUpdated();
   
-  DateTime newUpdated(AtomDate dateTime);
-  
-  DateTime newUpdated(Date date);
-  
-  DateTime newUpdated(String date);
-  
-  DateTime newUpdated(Calendar date);
-  
-  DateTime newUpdated(long date);
-  
   DateTime newUpdated(Element parent);
   
-  DateTime newUpdated(AtomDate dateTime, Element parent);
-  
-  DateTime newUpdated(Date date, Element parent);
-  
-  DateTime newUpdated(String date, Element parent);
-  
-  DateTime newUpdated(Calendar date, Element parent);
-  
-  DateTime newUpdated(long date, Element parent);
-  
   DateTime newDateTime(QName qname, Element parent);
   
-  DateTime newDateTime(QName qname, AtomDate dateTime, Element parent);
-  
-  DateTime newDateTime(QName qname, Date date, Element parent);
-  
-  DateTime newDateTime(QName qname, String date, Element parent);
-  
-  DateTime newDateTime(QName qname, Calendar date, Element parent);
-  
-  DateTime newDateTime(QName qname, long date, Element parent);
-  
   Generator newDefaultGenerator();
   
   Generator newDefaultGenerator(Element parent);
@@ -209,106 +117,38 @@
   
   Generator newGenerator(Element parent);
   
-  Generator newGenerator(URI uri, String version, String value);
-  
-  Generator newGenerator(URI uri, String version, String value, Element parent);
-  
   IRI newID();
   
-  IRI newID(String id) throws URISyntaxException;
-  
-  IRI newID(URI id);
-  
   IRI newID(Element parent);
   
-  IRI newID(String id, Element parent) throws URISyntaxException;
-  
-  IRI newID(URI id, Element parent);
-
   IRI newIcon();
   
-  IRI newIcon(String uri) throws URISyntaxException;
-  
-  IRI newIcon(URI uri);
-  
   IRI newIcon(Element parent);
 
-  IRI newIcon(URI uri, Element parent);
-  
-  IRI newIcon(String URI, Element parent) throws URISyntaxException;
-  
   IRI newLogo();
   
-  IRI newLogo(String uri) throws URISyntaxException;
-  
-  IRI newLogo(URI uri);
-  
   IRI newLogo(Element parent);
   
-  IRI newLogo(URI uri, Element parent);
-  
-  IRI newLogo(String URI, Element parent) throws URISyntaxException;
-
   IRI newUri();
   
-  IRI newUri(URI uri);
-  
-  IRI newUri(String uri) throws URISyntaxException;
-  
   IRI newUri(Element parent);
   
-  IRI newUri(URI uri, Element parent);
-  
-  IRI newUri(String uri, Element parent) throws URISyntaxException;
-  
   IRI newIRIElement(QName qname, Element parent);
   
-  IRI newIRIElement(QName qname, URI uri, Element parent);
-  
-  IRI newIRIElement(QName qname, String URI, Element parent) throws URISyntaxException;
-
   Link newLink();
   
-  Link newLink(String href, String rel, MimeType type, String title, String hreflang, long length) throws URISyntaxException;
-  
-  Link newLink(URI href, String rel, MimeType type, String title, String hreflang, long length);
-  
   Link newLink(Element parent);
   
-  Link newLink(String href, String rel, MimeType type, String title, String hreflang, long length, Element parent) throws URISyntaxException;
-  
-  Link newLink(URI href, String rel, MimeType type, String title, String hreflang, long length, Element parent);
-
   Person newAuthor();
   
-  Person newAuthor(String name, String email, String uri) throws URISyntaxException;
-  
-  Person newAuthor(String name, String email, URI uri);
-  
   Person newAuthor(Element parent);
   
-  Person newAuthor(String name, String email, String uri, Element parent) throws URISyntaxException;
-  
-  Person newAuthor(String name, String email, URI uri, Element parent);  
-
   Person newContributor();
 
-  Person newContributor(String name, String email, String uri) throws URISyntaxException;
-  
-  Person newContributor(String name, String email, URI uri);  
-  
   Person newContributor(Element parent);
 
-  Person newContributor(String name, String email, String uri, Element parent) throws URISyntaxException;
-  
-  Person newContributor(String name, String email, URI uri, Element parent);  
-
   Person newPerson(QName qname, Element parent);
   
-  Person newPerson(QName qname, String name, String email, String uri, Element parent) throws URISyntaxException;
-  
-  Person newPerson(QName qname, String name, String email, URI uri, Element parent);
-  
   Source newSource();
   
   Source newSource(Element parent);
@@ -319,119 +159,55 @@
   
   Text newTitle();
   
-  Text newTitle(String value);
-  
   Text newTitle(Element parent);
   
   Text newTitle(Text.Type type);
   
   Text newTitle(Text.Type type, Element parent);
   
-  Text newTitle(String value, Text.Type type);
-  
-  Text newTitle(String value, Text.Type type, Element parent);
-  
-  Text newTitle(Div value);
-  
-  Text newTitle(Div value, Element parent);
-
   Text newSubtitle();
 
-  Text newSubtitle(String value);
-  
   Text newSubtitle(Element parent);
   
   Text newSubtitle(Text.Type type);
   
   Text newSubtitle(Text.Type type, Element parent);
   
-  Text newSubtitle(String value, Text.Type type);
-  
-  Text newSubtitle(String value, Text.Type type, Element parent);
-  
-  Text newSubtitle(Div value);
-  
-  Text newSubtitle(Div value, Element parent);
-  
   Text newSummary();
   
-  Text newSummary(String value);
-  
   Text newSummary(Element parent);
   
   Text newSummary(Text.Type type);
   
   Text newSummary(Text.Type type, Element parent);
   
-  Text newSummary(String value, Text.Type type);
-  
-  Text newSummary(String value, Text.Type type, Element parent);
-  
-  Text newSummary(Div value);
-  
-  Text newSummary(Div value, Element parent);
-
   Text newRights();
   
-  Text newRights(String value);
-  
   Text newRights(Element parent);
   
   Text newRights(Text.Type type);
   
   Text newRights(Text.Type type, Element parent);
   
-  Text newRights(String value, Text.Type type);
-  
-  Text newRights(String value, Text.Type type, Element parent);
-  
-  Text newRights(Div value);
-  
-  Text newRights(Div value, Element parent);
-
-  Text newText(QName qname, String value, Text.Type type);
-  
-  Text newText(QName qname, String value, Text.Type type, Element parent);
-  
-  Text newText(QName qname, Div value);
-  
-  Text newText(QName qname, Div value, Element parent);
-
   Element newName();
   
-  Element newName(String value);
-  
   Element newName(Element parent);
   
-  Element newName(String value, Element parent);
-  
   Element newEmail();
   
-  Element newEmail(String value);
-  
   Element newEmail(Element parent);
   
-  Element newEmail(String value, Element parent);
-  
   Element newElement(QName qname);
   
-  Element newElement(QName qname, String value);
-  
   Element newElement(QName qname, Base parent);
   
-  Element newElement(QName qname, String value, Base parent);
-
   Element newExtensionElement(QName qname);
   
   Element newExtensionElement(QName qname, Base parent);
   
   Control newControl();
   
-  Control newControl(boolean draft);
-  
   Control newControl(Element parent);
-  
-  Control newControl(boolean draft, Element parent);
   
   Div newDiv();
   

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=420662&r1=420661&r2=420662&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 Mon Jul 10 16:42:23 2006
@@ -127,6 +127,10 @@
     if (value != null) {
       if (this.getFirstElement() != null)
         this.getFirstElement().discard();
+      if (value instanceof Div && !type.equals(Content.Type.XML)) 
+        init(Content.Type.XHTML);
+      else 
+        init(Content.Type.XML);
       this.setFirstChild((OMElement)value);
     } else {
       _removeAllChildren();

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java?rev=420662&r1=420661&r2=420662&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java Mon Jul 10 16:42:23 2006
@@ -128,12 +128,20 @@
 
   public Person addAuthor(String name, String email, String uri) throws URISyntaxException {
     FOMFactory fomfactory = (FOMFactory) this.factory;
-    return fomfactory.newAuthor(name, email, uri, this);
+    Person person = fomfactory.newAuthor(this);
+    person.setName(name);
+    person.setEmail(email);
+    person.setUri(uri);
+    return person;
   }
   
   public Person addAuthor(String name, String email, URI uri) {
     FOMFactory fomfactory = (FOMFactory) this.factory;
-    return fomfactory.newAuthor(name, email, uri, this);    
+    Person person = fomfactory.newAuthor(this);
+    person.setName(name);
+    person.setEmail(email);
+    person.setUri(uri);
+    return person;    
   }
 
   public List<Category> getCategories() {
@@ -176,12 +184,20 @@
 
   public Category addCategory(URI scheme, String term, String label) {
     FOMFactory factory = (FOMFactory) this.factory;
-    return factory.newCategory(term, scheme, label, this);
+    Category category = factory.newCategory(this);
+    category.setTerm(term);
+    category.setScheme(scheme);
+    category.setLabel(label);
+    return category;
   }
   
   public Category addCategory(String scheme, String term, String label) throws URISyntaxException {
     FOMFactory factory = (FOMFactory) this.factory;
-    return factory.newCategory(term, new URI(scheme), label, this);    
+    Category category = factory.newCategory(this);
+    category.setTerm(term);
+    category.setScheme(scheme);
+    category.setLabel(label);
+    return category;    
   }
   
   @SuppressWarnings("unchecked")
@@ -211,7 +227,8 @@
    */
   public Content setContent(String value) {
     FOMFactory factory = (FOMFactory) this.factory;
-    Content content = factory.newContent(value);
+    Content content = factory.newContent();
+    content.setValue(value);
     setContentElement(content);
     return content;
   }
@@ -239,7 +256,8 @@
    */
   public Content setContent(String value, Content.Type type) {
     FOMFactory factory = (FOMFactory) this.factory;
-    Content content = factory.newContent(value, type);
+    Content content = factory.newContent(type);
+    content.setValue(value);
     setContentElement(content);
     return content;
   }
@@ -249,7 +267,8 @@
    */
   public Content setContent(Element value, Content.Type type) {
     FOMFactory factory = (FOMFactory) this.factory;
-    Content content = factory.newContent(value, type);
+    Content content = factory.newContent(type);
+    content.setValueElement(value);
     setContentElement(content);
     return content;
   } 
@@ -269,7 +288,8 @@
    */
   public Content setContent(URI src, MimeType mediaType) {
     FOMFactory factory = (FOMFactory) this.factory;
-    Content content = factory.newContent(src, mediaType);
+    Content content = factory.newContent(mediaType);
+    content.setSrc(src);
     setContentElement(content);
     return content;
   }
@@ -289,7 +309,8 @@
    */
   public Content setContent(DataHandler dataHandler, MimeType mediatype) {
     FOMFactory factory = (FOMFactory) this.factory;
-    Content content = factory.newContent(dataHandler, mediatype);
+    Content content = factory.newContent(mediatype);
+    content.setDataHandler(dataHandler);
     setContentElement(content);
     return content;
   }
@@ -299,7 +320,8 @@
    */
   public Content setContent(String value, MimeType mediatype) {
     FOMFactory factory = (FOMFactory) this.factory;
-    Content content = factory.newContent(value, mediatype);
+    Content content = factory.newContent(mediatype);
+    content.setValue(value);
     setContentElement(content);
     return content;
   }
@@ -330,7 +352,11 @@
     String uri) 
       throws URISyntaxException {
     FOMFactory fomfactory = (FOMFactory) this.factory;
-    return fomfactory.newContributor(name, email, uri, this);
+    Person person = fomfactory.newContributor(this);
+    person.setName(name);
+    person.setEmail(email);
+    person.setUri(uri);
+    return person;
   }
   
   public Person addContributor(
@@ -338,7 +364,11 @@
     String email, 
     URI uri) {
       FOMFactory fomfactory = (FOMFactory) this.factory;
-      return fomfactory.newContributor(name, email, uri, this);    
+      Person person = fomfactory.newContributor(this);
+      person.setName(name);
+      person.setEmail(email);
+      person.setUri(uri);
+      return person;    
   }
   
   public IRI getIdElement() {
@@ -377,8 +407,9 @@
       return id;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newID(
-        (normalize) ? URIHelper.normalize(value) : value, this);
+      IRI iri = fomfactory.newID(this);
+      iri.setValue((normalize) ? URIHelper.normalize(value) : value);
+      return iri;
     }
   }
   
@@ -422,7 +453,10 @@
   
   public Link addLink(String href, String rel) throws URISyntaxException {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(href, rel, null, null, null, -1, this);    
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    if (rel != null) link.setRel(rel);
+    return link;    
   }
   
   public Link addLink(URI href) {
@@ -431,7 +465,10 @@
   
   public Link addLink(URI href, String rel) {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(href, rel, null, null, null, -1, this);
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    link.setRel(rel);
+    return link;
   }
   
   public Link addLink(
@@ -442,8 +479,14 @@
     String hreflang, 
     long length) {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(
-      href, rel, type, title, hreflang, length, this);
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    link.setRel(rel);
+    link.setMimeType(type);
+    link.setTitle(title);
+    link.setHrefLang(hreflang);
+    link.setLength(length);
+    return link;    
   }
   
   public Link addLink(
@@ -455,8 +498,14 @@
     long length) 
       throws URISyntaxException {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(
-      href, rel, type, title, hreflang, length, this);
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    link.setRel(rel);
+    link.setMimeType(type);
+    link.setTitle(title);
+    link.setHrefLang(hreflang);
+    link.setLength(length);
+    return link;
   }
   
   public Link addLink(
@@ -468,8 +517,14 @@
     long length) 
       throws MimeTypeParseException {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(
-      href, rel, new MimeType(type), title, hreflang, length, this);
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    link.setRel(rel);
+    link.setMimeType(type);
+    link.setTitle(title);
+    link.setHrefLang(hreflang);
+    link.setLength(length);
+    return link;
   }
   
   public Link addLink(
@@ -481,8 +536,14 @@
     long length) 
       throws URISyntaxException, MimeTypeParseException {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(
-      href, rel, new MimeType(type), title, hreflang, length, this);
+    Link link = fomfactory.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() {
@@ -517,7 +578,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newPublished(value, this);
+      DateTime dt = fomfactory.newPublished(this);
+      dt.setDate(value);
+      return dt;
     }
   }
   
@@ -532,7 +595,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newPublished(value, this);
+      DateTime dt = fomfactory.newPublished(this);
+      dt.setCalendar(value);
+      return dt;
     }
   }
   
@@ -543,7 +608,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newPublished(value, this);
+      DateTime dt = fomfactory.newPublished(this);
+      dt.setTime(value);
+      return dt;
     }
   }
   
@@ -558,7 +625,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newPublished(value, this);
+      DateTime dt = fomfactory.newPublished(this);
+      dt.setString(value);
+      return dt;
     }
   }
   
@@ -580,7 +649,8 @@
   
   public Text setRights(String value) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newRights(value);
+    Text text = factory.newRights();
+    text.setValue(value);
     setRightsElement(text);
     return text;
   }
@@ -602,7 +672,8 @@
   
   public Text setRights(String value, Text.Type type) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newRights(value, type);
+    Text text = factory.newRights(type);
+    text.setValue(value);
     setRightsElement(text);
     return text;
   }
@@ -650,7 +721,8 @@
   
   public Text setSummary(String value) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newSummary(value);
+    Text text = factory.newSummary();
+    text.setValue(value);
     setSummaryElement(text);
     return text;
   }
@@ -672,7 +744,8 @@
   
   public Text setSummary(String value, Text.Type type) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newSummary(value, type);
+    Text text = factory.newSummary(type);
+    text.setValue(value);
     setSummaryElement(text);
     return text;
   }
@@ -706,7 +779,8 @@
   
   public Text setTitle(String value) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newTitle(value);
+    Text text = factory.newTitle();
+    text.setValue(value);
     setTitleElement(text);
     return text;
   }
@@ -728,7 +802,8 @@
   
   public Text setTitle(String value, Text.Type type) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newTitle(value, type);
+    Text text = factory.newTitle(type);
+    text.setValue(value);
     setTitleElement(text);
     return text;
   }
@@ -776,7 +851,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newUpdated(value, this);
+      DateTime dt = fomfactory.newUpdated(this);
+      dt.setDate(value);
+      return dt;
     }
   }
   
@@ -791,7 +868,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newUpdated(value, this);
+      DateTime dt = fomfactory.newUpdated(this);
+      dt.setCalendar(value);
+      return dt;
     }
   }
   
@@ -802,7 +881,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newUpdated(value, this);
+      DateTime dt = fomfactory.newUpdated(this);
+      dt.setTime(value);
+      return dt;
     }
   }
   
@@ -817,7 +898,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newUpdated(value, this);
+      DateTime dt = fomfactory.newUpdated(this);
+      dt.setString(value);
+      return dt;
     }
   }
 

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java?rev=420662&r1=420661&r2=420662&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java Mon Jul 10 16:42:23 2006
@@ -133,7 +133,9 @@
 
   public Element addSimpleExtension(QName qname, String value) {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newElement(qname, value, this);
+    Element el = fomfactory.newElement(qname, this);
+    el.setText(value);
+    return el;
   }
   
   public Element addSimpleExtension(

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java?rev=420662&r1=420661&r2=420662&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java Mon Jul 10 16:42:23 2006
@@ -17,21 +17,15 @@
 */
 package org.apache.abdera.parser.stax;
  
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Calendar;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.activation.DataHandler;
 import javax.activation.MimeType;
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.factory.ExtensionFactory;
 import org.apache.abdera.factory.Factory;
-import org.apache.abdera.model.AtomDate;
 import org.apache.abdera.model.Base;
 import org.apache.abdera.model.Category;
 import org.apache.abdera.model.Collection;
@@ -107,13 +101,13 @@
   
   @SuppressWarnings("unchecked")
   public <T extends Element>Document<T> newDocument() {
-    return _newInstance(FOMDocument.class);
+    return _newInstance(FOMDocument.class, CONSTRUCTORS[8], this);
   }
   
   @SuppressWarnings("unchecked")
   public <T extends Element>Document<T> newDocument(
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMDocument.class, parserWrapper);
+      return _newInstance(FOMDocument.class, CONSTRUCTORS[9], this, parserWrapper);
   }
   
   public <T extends Element>Document<T> newDocument(
@@ -128,19 +122,19 @@
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMService.class, qname, parent, parserWrapper);
+      return _newInstance(FOMService.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
 
   public Service newService(
     Base parent) {
-      return _newInstance(FOMService.class, (OMContainer)parent);
+      return _newInstance(FOMService.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
 
   public Workspace newWorkspace(
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMWorkspace.class, qname, parent, parserWrapper);
+      return _newInstance(FOMWorkspace.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Workspace newWorkspace() {
@@ -149,14 +143,14 @@
   
   public Workspace newWorkspace(
     Element parent) {
-      return _newInstance(FOMWorkspace.class, (OMContainer)parent);
+      return _newInstance(FOMWorkspace.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
 
   public Collection newCollection(
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMCollection.class, qname, parent, parserWrapper);
+      return _newInstance(FOMCollection.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Collection newCollection() {
@@ -165,7 +159,7 @@
   
   public Collection newCollection(
     Element parent) {
-      return _newInstance(FOMCollection.class, (OMContainer)parent);
+      return _newInstance(FOMCollection.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
 
   public Feed newFeed() {
@@ -187,31 +181,31 @@
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMFeed.class, qname, parent, parserWrapper);
+      return _newInstance(FOMFeed.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Feed newFeed(
     Base parent) {
-      return _newInstance(FOMFeed.class, (OMContainer)parent);
+      return _newInstance(FOMFeed.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
 
   public Entry newEntry(
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMEntry.class, qname, parent, parserWrapper);
+      return _newInstance(FOMEntry.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Entry newEntry(
     Base parent) {
-      return _newInstance(FOMEntry.class, (OMContainer)parent);
+      return _newInstance(FOMEntry.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
 
   public Category newCategory(
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMCategory.class, qname, parent, parserWrapper);
+      return _newInstance(FOMCategory.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Category newCategory() {
@@ -220,37 +214,7 @@
   
   public Category newCategory(
     Element parent) {
-      return _newInstance(FOMCategory.class, (OMContainer)parent);
-  }
-
-  public Category newCategory(String term) {
-    return newCategory(term, null);
-  }
-  
-  public Category newCategory(String term, Element parent) {
-    return newCategory(term, null, null, parent);
-  }
-  
-  public Category newCategory(
-    String term, 
-    URI scheme, 
-    String label) {
-      return newCategory(term, scheme, label, null);
-  }
-  
-  public Category newCategory(
-    String term, 
-    URI scheme, 
-    String label, 
-    Element parent) {
-    Category category = newCategory(parent);
-    if (scheme != null)
-      category.setScheme(scheme);
-    if (term != null)
-      category.setTerm(term);
-    if (label != null)
-    category.setLabel(label);
-    return category;
+      return _newInstance(FOMCategory.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
 
   public Content newContent(
@@ -259,17 +223,14 @@
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
       if (type == null) type = Content.Type.TEXT;
-      return _newInstance(FOMContent.class, qname, type, parent, parserWrapper);
+      return _newInstance(FOMContent.class, CONSTRUCTORS[2], 
+          qname, type, parent, this, parserWrapper);
   }
   
   public Content newContent() {
     return newContent(Content.Type.TEXT);
   }
   
-  public Content newContent(String value) {
-    return newContent(value, Content.Type.TEXT);
-  }
-  
   public Content newContent(Type type) {
     if (type == null) type = Content.Type.TEXT;
     return newContent(type, (Element)null);
@@ -281,7 +242,7 @@
       if (type == null) type = Content.Type.TEXT;
       Content content = 
         _newInstance(
-          FOMContent.class, type, (OMContainer)parent);
+          FOMContent.class, CONSTRUCTORS[3], type, (OMContainer)parent, this);
       if (type.equals(Content.Type.XML))
         content.setMimeType("application/xml");
       return content;
@@ -291,90 +252,6 @@
     return newContent(mediaType, (Element)null);
   }
   
-  public Content newContent(String value, Content.Type type) {
-    return newContent(value, type, null);
-  }
-
-  public Content newContent(String value, Content.Type type, Element parent) {
-    Content content = newContent(type, parent);
-    content.setValue(value);
-    return content;
-  }
-  
-  public Content newContent(Element value, Content.Type type) {
-    return newContent(value, type, null);
-  }
-  
-  public Content newContent(Element value, Content.Type type, Element parent) {
-    Content content = newContent(type, parent);
-    content.setValueElement(value);
-    return content;
-  }
-  
-  public Content newContent(
-    String value, 
-    MimeType mediaType) {
-      return newContent(value, mediaType, null);
-  }
-  
-  public Content newContent(
-    String value,
-    MimeType mediaType,
-    Element parent) {
-    Content content = newContent(mediaType, parent);
-    content.setValue(value);
-    return content;
-  }
-  
-  public Content newContent(
-    DataHandler dataHandler, 
-    MimeType mediaType) { 
-      return newContent(dataHandler, mediaType, null);
-  }
-  
-  public Content newContent(
-    DataHandler dataHandler, 
-    MimeType mediaType, 
-    Element parent) {
-      Content content = newContent(mediaType, parent);
-      if (dataHandler != null)
-        content.setDataHandler(dataHandler);
-      if (mediaType != null)
-        content.setMimeType(mediaType);
-      return content;
-  }
-
-  public Content newContent(
-    Element value,
-    MimeType mediaType) {
-      return newContent(value, mediaType, null);
-  }
-  
-  public Content newContent(
-    Element value, 
-    MimeType mediaType, 
-    Element parent) {
-      Content content = 
-        newContent(
-          mediaType, 
-          parent);
-      content.setValueElement(value);
-      return content;
-  }
-
-  public Content newContent(URI src, MimeType mediaType)  {
-    return newContent(src, mediaType, (Element)null);
-  }
-  
-  public Content newContent(URI src, MimeType mediaType, Element parent) {
-    Content content = 
-      newContent(
-        mediaType, 
-        parent);
-    content.setSrc(src);
-    return content;
-  }
-  
   public Content newContent(
     MimeType mediaType, 
     Element parent) {
@@ -390,65 +267,20 @@
     QName qname,
     OMContainer parent,
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMDateTime.class, qname, parent, parserWrapper);
+      return _newInstance(FOMDateTime.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public DateTime newDateTime(
     QName qname, 
     Element parent) {
-      return _newInstance(FOMDateTime.class, qname, (OMContainer)parent);
-  }
-
-  public DateTime newDateTime(
-    QName qname, 
-    AtomDate dateTime, 
-    Element parent) {
-    DateTime dt = newDateTime(qname, parent);
-    dt.setValue(dateTime);
-    return dt;
-  }
-
-  public DateTime newDateTime(
-    QName qname, 
-    Date date, 
-    Element parent) {
-    DateTime dt = newDateTime(qname, parent);
-    dt.setValue(AtomDate.valueOf(date));
-    return dt;
-  }
-
-  public DateTime newDateTime(
-    QName qname, 
-    String date, 
-    Element parent) {
-    DateTime dt = newDateTime(qname, parent);
-    dt.setValue(AtomDate.valueOf(date));
-    return dt;
-  }
-
-  public DateTime newDateTime(
-    QName qname, 
-    Calendar date, 
-    Element parent) {
-    DateTime dt = newDateTime(qname, parent);
-    dt.setValue(AtomDate.valueOf(date));
-    return dt;
-  }
-
-  public DateTime newDateTime(
-    QName qname, 
-    long date, 
-    Element parent) {
-    DateTime dt = newDateTime(qname, parent);
-    dt.setValue(AtomDate.valueOf(date));
-    return dt;
+      return _newInstance(FOMDateTime.class, CONSTRUCTORS[4], qname, (OMContainer)parent, this);
   }
 
   public Generator newGenerator(
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMGenerator.class, qname, parent, parserWrapper);
+      return _newInstance(FOMGenerator.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Generator newDefaultGenerator() {
@@ -472,113 +304,47 @@
   
   public Generator newGenerator(
       Element parent) {
-    return _newInstance(FOMGenerator.class, (OMContainer)parent);
-  }
-
-  public Generator newGenerator(
-    URI uri, 
-    String version, 
-    String value) {  
-      return newGenerator(uri, version, value, null);
-  }
-  
-  public Generator newGenerator(
-    URI uri, 
-    String version, 
-    String value, 
-    Element parent) {
-    Generator generator = newGenerator(parent);
-    if (uri != null)
-      generator.setUri(uri);
-    if (version != null)
-      generator.setVersion(version);
-    if (value != null)
-      generator.setText(value);
-    return generator;
+    return _newInstance(FOMGenerator.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
 
   public IRI newID(
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMIRI.class, qname, parent, parserWrapper);
+      return _newInstance(FOMIRI.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public IRI newID() {
     return newID((Element)null);
   }
   
-  public IRI newID(String id) throws URISyntaxException {
-    return newID(id, null);
-  }
-  
-  public IRI newID(URI id) {
-    return newID(id, null);
-  }
-  
   public IRI newID(
     Element parent) {
-      return _newInstance(FOMIRI.class, Constants.ID, (OMContainer)parent);
-  }
-
-  public IRI newID(
-    String id, 
-    Element parent) 
-      throws URISyntaxException {
-    IRI _id = newID(parent);
-    if (id != null)
-      _id.setValue(new URI(id));
-    return _id;
-  }
-
-  public IRI newID(
-    URI id, 
-    Element parent) {
-      IRI _id = newID(parent);
-      if (id != null)
-      _id.setValue(id);
-      return _id;
+      return _newInstance(
+          FOMIRI.class, CONSTRUCTORS[4], 
+          Constants.ID, (OMContainer)parent, this);
   }
 
   public IRI newURIElement(
     QName qname,
     OMContainer parent,
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMIRI.class, qname, parent, parserWrapper);
+      return _newInstance(FOMIRI.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public IRI newIRIElement(
     QName qname, 
     Element parent) {
-      return _newInstance(FOMIRI.class, qname, (OMContainer)parent);
-  }
-
-  public IRI newIRIElement(
-    QName qname, 
-    URI uri, 
-    Element parent) {
-    IRI iri = newIRIElement(qname, parent);
-    if (uri != null)
-      iri.setValue(uri);
-    return iri;
-  }
-
-  public IRI newIRIElement(
-    QName qname, 
-    String URI, 
-    Element parent) 
-      throws URISyntaxException {
-    IRI iri = newIRIElement(qname, parent);
-    if (URI != null)
-      iri.setValue(new URI(URI));
-    return iri;
+      return _newInstance(
+        FOMIRI.class, CONSTRUCTORS[4], 
+        qname, (OMContainer)parent, this);
   }
 
   public Link newLink(
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMLink.class, qname, parent, parserWrapper);
+      return _newInstance(FOMLink.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Link newLink() {
@@ -586,129 +352,30 @@
   }
   
   public Link newLink(
-    String href, 
-    String rel, 
-    MimeType type, 
-    String title, 
-    String hreflang, 
-    long length) 
-      throws URISyntaxException {
-    return newLink(href, rel, type, title, hreflang, length, null);
-  }
-  
-  public Link newLink(
-    URI href, 
-    String rel, 
-    MimeType type, 
-    String title, 
-    String hreflang, 
-    long length) {
-      return newLink(href, rel, type, title, hreflang, length, null);
-  }
-  
-  public Link newLink(
     Element parent) {
-      return _newInstance(FOMLink.class, (OMContainer)parent);
-  }
-
-  public Link newLink(
-    String href, 
-    String rel, 
-    MimeType type, 
-    String title,
-    String hreflang, 
-    long length, 
-    Element parent) throws URISyntaxException {
-    Link link = newLink(parent);
-    if (href != null)
-      link.setHref(new URI(href));
-    if (rel != null)
-      link.setRel(rel);
-    if (title != null)
-      link.setTitle(title);
-    if (type != null)
-      link.setMimeType(type);
-    if (hreflang != null)
-      link.setHrefLang(hreflang);
-    if (length > -1)
-      link.setLength(length);
-    return link;
-  }
-
-  public Link newLink(
-    URI href, 
-    String rel, 
-    MimeType type, 
-    String title, 
-    String hreflang, 
-    long length, 
-    Element parent) {
-    Link link = newLink(parent);
-    if (href != null)
-      link.setHref(href);
-    if (rel != null)
-      link.setRel(rel);
-    if (title != null)
-      link.setTitle(title);
-    if (type != null)
-      link.setMimeType(type);
-    if (hreflang != null)
-      link.setHrefLang(hreflang);
-    if (length > -1)
-      link.setLength(length);
-    return link;
+      return _newInstance(FOMLink.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
 
   public Person newPerson(
     QName qname,
     OMContainer parent,
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMPerson.class, qname, parent, parserWrapper);
+      return _newInstance(FOMPerson.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Person newPerson(
     QName qname, 
     Element parent) {
-      return _newInstance(FOMPerson.class, qname, (OMContainer)parent);
-  }
-
-  public Person newPerson(
-    QName qname,
-    String name, 
-    String email, 
-    String uri, 
-    Element parent) throws URISyntaxException {
-    Person person = newPerson(qname, parent);
-    if (name != null)
-      person.setName(name);
-    if (email != null)
-      person.setEmail(email);
-    if (uri != null)
-      person.setUri(new URI(uri));
-    return person;
-  }
-
-  public Person newPerson(
-    QName qname, 
-    String name, 
-    String email,
-    URI uri, 
-    Element parent) {
-    Person person = newPerson(qname, parent);
-    if (name != null)
-      person.setName(name);
-    if (email != null)
-      person.setEmail(email);
-    if (uri != null)
-      person.setUri(uri);
-    return person;
+      return _newInstance(
+        FOMPerson.class, CONSTRUCTORS[4], 
+        qname, (OMContainer)parent, this);
   }
 
   public Source newSource(
     QName qname, 
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMSource.class, qname, parent, parserWrapper);
+      return _newInstance(FOMSource.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Source newSource() {
@@ -716,8 +383,8 @@
   }
   
   public Source newSource(
-      Element parent) {
-    return _newInstance(FOMSource.class, (OMContainer)parent);
+    Element parent) {
+      return _newInstance(FOMSource.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
 
   public Text newText(
@@ -726,7 +393,8 @@
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
     if (type == null) type = Text.Type.TEXT;
-    return _newInstance(FOMText.class, type, qname, parent, parserWrapper);
+    return _newInstance(FOMText.class, CONSTRUCTORS[5], 
+        type, qname, parent, this, parserWrapper);
   }
   
   public Text newText(
@@ -740,66 +408,22 @@
     Text.Type type, 
     Element parent) {
     if (type == null) type = Text.Type.TEXT;
-    return _newInstance(FOMText.class,type, qname,(OMContainer)parent);
-  }
-  
-  public Text newText(
-    QName qname, 
-    String value,
-    Text.Type type) {
-      return newText(qname, value, type, null);
-  }
-  
-  public Text newText(
-    QName qname, 
-    String value,
-    Text.Type type,
-    Element parent) {
-      Text text = newText(qname, type, parent);
-      text.setValue(value);
-      return text;
-  }
-
-  public Text newText(
-    QName qname,
-    Div value) {
-    return newText(qname, value, null);
+    return _newInstance(FOMText.class, CONSTRUCTORS[6], 
+        type, qname,(OMContainer)parent, this);
   }
   
-  public Text newText(
-    QName qname, 
-    Div value,
-    Element parent) {
-      Text text = newText(qname, Text.Type.XHTML, parent);
-      if (value != null)
-        text.setValueElement(value);
-      return text;
-  }
-
   public Element newElement(QName qname) {
     return newElement(qname, (Element)null);
   }
   
-  public Element newElement(QName qname, String value) {
-    return newElement(qname, value, null);
-  }
-  
   public Element newElement(
     QName qname, 
     Base parent) {
-      return _newInstance(FOMElement.class, qname, (OMContainer)parent);
+      return _newInstance(
+        FOMElement.class, CONSTRUCTORS[4], 
+        qname, (OMContainer)parent, this);
   }
   
-  public Element newElement(
-    QName qname, 
-    String value,
-    Base parent) {
-    Element el = newElement(qname, parent);
-    if (value != null)
-      el.setText(value);
-    return el;
-  }
-
   public Element newExtensionElement(QName qname) {
     return newExtensionElement(qname, (Base)null);
   }
@@ -842,9 +466,11 @@
     if (_class == null) _class = FOMElement.class;
     if (element == null) {
       if (parserWrapper != null) {
-        element = (Element) _newInstance(_class, qname, (OMContainer)parent, parserWrapper);
+        element = (Element) _newInstance(_class, CONSTRUCTORS[0], qname, (OMContainer)parent, this, parserWrapper);
       } else {
-        element = (Element) _newInstance(_class, qname, (OMContainer)parent);
+        element = (Element) _newInstance(
+          _class, CONSTRUCTORS[4], 
+          qname, (OMContainer)parent, this);
       }
     }
     return element;
@@ -860,278 +486,78 @@
     return newControl((Element)null);
   }
    
-  public Control newControl(boolean draft) {
-    return newControl(draft, null);
-  }
-  
   public Control newControl(Element parent) {
-    return _newInstance(FOMControl.class, (OMContainer)parent);
+    return _newInstance(FOMControl.class, CONSTRUCTORS[1], (OMContainer)parent, this);
   }
   
   public Control newControl(
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMControl.class, qname, parent, parserWrapper);
+      return _newInstance(FOMControl.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
 
   public DateTime newPublished() {
     return newPublished((Element)null);
   }
   
-  public DateTime newPublished(AtomDate dateTime) {
-    return newPublished(dateTime, null);
-  }
-  
-  public DateTime newPublished(Date date) {
-    return newPublished(date, null);
-  }
-  
-  public DateTime newPublished(String date) {
-    return newPublished(date, null);
-  }
-  
-  public DateTime newPublished(Calendar date) {
-    return newPublished(date, null);
-  }
-  
-  public DateTime newPublished(long date) {
-    return newPublished(date, null);
-  }
-  
   public DateTime newPublished(Element parent) {
     return newDateTime(Constants.PUBLISHED, parent);
   }
 
-  public DateTime newPublished(AtomDate dateTime, Element parent) {
-    return newDateTime(Constants.PUBLISHED, dateTime, parent);
-  }
-
-  public DateTime newPublished(Date date, Element parent) {
-    return newDateTime(Constants.PUBLISHED, date, parent);
-  }
-
-  public DateTime newPublished(String date, Element parent) {
-    return newDateTime(Constants.PUBLISHED, date, parent);
-  }
-
-  public DateTime newPublished(Calendar date, Element parent) {
-    return newDateTime(Constants.PUBLISHED, date, parent);
-  }
-
-  public DateTime newPublished(long date, Element parent) {
-    return newDateTime(Constants.PUBLISHED, date, parent);
-  }
-
   public DateTime newUpdated() {
     return newUpdated((Element)null);
   }
   
-  public DateTime newUpdated(AtomDate dateTime) {
-    return newUpdated(dateTime, null);
-  }
-  
-  public DateTime newUpdated(Date date) {
-    return newUpdated(date, null);
-  }
-  
-  public DateTime newUpdated(String date) {
-    return newUpdated(date, null);
-  }
-  
-  public DateTime newUpdated(Calendar date) {
-    return newUpdated(date, null);
-  }
-  
-  public DateTime newUpdated(long date) {
-    return newUpdated(date, null);
-  }
-  
   public DateTime newUpdated(Element parent) {
     return newDateTime(Constants.UPDATED, parent);
   }
 
-  public DateTime newUpdated(AtomDate dateTime, Element parent) {
-    return newDateTime(Constants.UPDATED, dateTime, parent);
-  }
-
-  public DateTime newUpdated(Date date, Element parent) {
-    return newDateTime(Constants.UPDATED, date, parent);
-  }
-
-  public DateTime newUpdated(String date, Element parent) {
-    return newDateTime(Constants.UPDATED, date, parent);
-  }
-
-  public DateTime newUpdated(Calendar date, Element parent) {
-    return newDateTime(Constants.UPDATED, date, parent);
-  }
-
-  public DateTime newUpdated(long date, Element parent) {
-    return newDateTime(Constants.UPDATED, date, parent);
-  }
-
   public IRI newIcon() {
     return newIcon((Element)null);
   }
   
-  public IRI newIcon(String uri) throws URISyntaxException {
-    return newIcon(uri, null);
-  }
-  
-  public IRI newIcon(URI uri) {
-    return newIcon(uri, null);
-  }
-  
   public IRI newIcon(Element parent) {
     return newIRIElement(Constants.ICON, parent);
   }
 
-  public IRI newIcon(URI uri, Element parent) {
-    return newIRIElement(Constants.ICON, uri, parent);
-  }
-
-  public IRI newIcon(String URI, Element parent) throws URISyntaxException {
-    return newIRIElement(Constants.ICON, URI, parent);
-  }
-
   public IRI newLogo() {
     return newLogo((Element)null);
   }
   
-  public IRI newLogo(String uri) throws URISyntaxException {
-    return newLogo(uri, null);
-  }
-  
-  public IRI newLogo(URI uri) {
-    return newLogo(uri, null);
-  }
-  
   public IRI newLogo(Element parent) {
     return newIRIElement(Constants.LOGO, parent);
   }
 
-  public IRI newLogo(URI uri, Element parent) {
-    return newIRIElement(Constants.LOGO, uri, parent);
-  }
-
-  public IRI newLogo(String URI, Element parent) throws URISyntaxException {
-    return newIRIElement(Constants.LOGO, URI, parent);
-  }
-
   public IRI newUri() {
     return newUri((Element)null);
   }
   
-  public IRI newUri(URI uri) {
-    return newUri(uri, null);
-  }
-  
-  public IRI newUri(String uri) throws URISyntaxException {
-    return newUri(uri, null);
-  }
-  
   public IRI newUri(Element parent) {
     return newIRIElement(Constants.URI, parent);
   }
 
-  public IRI newUri(URI uri, Element parent) {
-    return newIRIElement(Constants.URI, uri, parent);
-  }
-
-  public IRI newUri(String URI, Element parent) throws URISyntaxException {
-    return newIRIElement(Constants.URI, URI, parent);
-  }
-
   public Person newAuthor() {
     return newAuthor((Element)null);
   }
   
-  public Person newAuthor(
-    String name, 
-    String email, 
-    String uri) 
-      throws URISyntaxException {
-    return newAuthor(name, email, uri, null);
-  }
-  
-  public Person newAuthor(
-    String name, 
-    String email, 
-    URI uri) {
-      return newAuthor(name, email, uri, null);
-  }
-  
   public Person newAuthor(Element parent) {
     return newPerson(Constants.AUTHOR, parent);
   }
 
-  public Person newAuthor(
-    String name, 
-    String email, 
-    String uri, 
-    Element parent) 
-      throws URISyntaxException {
-    return newPerson(Constants.AUTHOR, name, email, uri, parent);
-  }
-
-  public Person newAuthor(
-    String name, 
-    String email, 
-    URI uri, 
-    Element parent) {
-      return newPerson(Constants.AUTHOR, name, email, uri, parent);
-  }
-
   public Person newContributor() {
     return newContributor((Element)null);
   }
 
   public Person newContributor(
-    String name, 
-    String email, 
-    String uri) 
-      throws URISyntaxException {
-    return newContributor(name, email, uri, null);
-  }
-  
-  public Person newContributor(
-    String name, 
-    String email, 
-    URI uri) {
-      return newContributor(name, email, uri, null);
-  }
-  
-  public Person newContributor(
     Element parent) {
       return newPerson(Constants.CONTRIBUTOR, parent);
   }
 
-  public Person newContributor(
-    String name, 
-    String email, 
-    String uri, 
-    Element parent) 
-      throws URISyntaxException {
-    return newPerson(Constants.CONTRIBUTOR, name, email, uri, parent);
-  }
-
-  public Person newContributor(
-    String name, 
-    String email, 
-    URI uri, 
-    Element parent) {
-      return newPerson(Constants.CONTRIBUTOR, name, email, uri, parent);
-  }
-
   public Text newTitle() {
     return newTitle(Text.Type.TEXT);
   }
   
-  public Text newTitle(String value) {
-    return newTitle(value, Text.Type.TEXT);
-  }
-  
   public Text newTitle(Element parent) {
     return newTitle(Text.Type.TEXT, parent);
   }
@@ -1144,34 +570,10 @@
     return newText(Constants.TITLE, type, parent);
   }
   
-  public Text newTitle(String value, Text.Type type) {
-    return newTitle(value, type, null);
-  }
-  
-  public Text newTitle(String value, Text.Type type, Element parent) {
-    Text text = newText(Constants.TITLE, type, parent);
-    text.setValue(value);
-    return text;
-  }
-  
-  public Text newTitle(Div value) {
-    return newTitle(value, null);
-  }
-  
-  public Text newTitle(
-    Div value,
-    Element parent) {
-      return newText(Constants.TITLE, value, parent);
-  }
-
   public Text newSubtitle() {
     return newSubtitle(Text.Type.TEXT);
   }
   
-  public Text newSubtitle(String value) {
-    return newSubtitle(value, Text.Type.TEXT);
-  }
-  
   public Text newSubtitle(Element parent) {
     return newSubtitle(Text.Type.TEXT, parent);
   }
@@ -1184,74 +586,26 @@
     return newText(Constants.SUBTITLE, type, parent);
   }
   
-  public Text newSubtitle(String value, Text.Type type) {
-    return newSubtitle(value, type, null);
-  }
-  
-  public Text newSubtitle(String value, Text.Type type, Element parent) {
-    Text text = newText(Constants.SUBTITLE, type, parent);
-    text.setValue(value);
-    return text;
-  }
-  
-  public Text newSubtitle(Div value) {
-    return newSubtitle(value, null);
-  }
-  
-  public Text newSubtitle(
-    Div value,
-    Element parent) {
-      return newText(Constants.SUBTITLE, value, parent);
-  }
-
   public Text newSummary() {
     return newSummary(Text.Type.TEXT);
   }
   
-  public Text newSummary(String value) {
-    return newSummary(value, Text.Type.TEXT);
-  }
-  
   public Text newSummary(Element parent) {
     return newSummary(Text.Type.TEXT, parent);
   }
   
   public Text newSummary(Text.Type type) {
-    return newSubtitle(type, (Element)null);
+    return newSummary(type, (Element)null);
   }
   
   public Text newSummary(Text.Type type, Element parent) {
     return newText(Constants.SUMMARY, type, parent);
   }
   
-  public Text newSummary(String value, Text.Type type) {
-    return newSummary(value, type, null);
-  }
-  
-  public Text newSummary(String value, Text.Type type, Element parent) {
-    Text text = newText(Constants.SUMMARY, type, parent);
-    text.setValue(value);
-    return text;
-  }
-  
-  public Text newSummary(Div value) {
-    return newSummary(value, null);
-  }
-  
-  public Text newSummary(
-    Div value,
-    Element parent) {
-      return newText(Constants.SUMMARY, value, parent);
-  }
-
   public Text newRights() {
     return newRights(Text.Type.TEXT);
   }
   
-  public Text newRights(String value) {
-    return newRights(value, Text.Type.TEXT);
-  }
-  
   public Text newRights(Element parent) {
     return newRights(Text.Type.TEXT, parent);
   }
@@ -1264,84 +618,44 @@
     return newText(Constants.RIGHTS, type, parent);
   }
   
-  public Text newRights(String value, Text.Type type) {
-    return newRights(value, type, null);
-  }
-  
-  public Text newRights(String value, Text.Type type, Element parent) {
-    Text text = newText(Constants.RIGHTS, type, parent);
-    text.setValue(value);
-    return text;
-  }
-  
-  public Text newRights(Div value) {
-    return newRights(value, null);
-  }
-  
-  public Text newRights(
-    Div value,
-    Element parent) {
-      return newText(Constants.RIGHTS, value, parent);
-  }
-
   public Element newName() {
     return newName((Element)null);
   }
   
-  public Element newName(String value) {
-    return newName(value, null);
-  }
-  
   public Element newName(Element parent) {
     return newElement(Constants.NAME, parent);
   }
 
-  public Element newName(String value, Element parent) {
-    return newElement(Constants.NAME, value, parent);
-  }
-
   public Element newEmail() {
     return newEmail((Element)null);
   }
   
-  public Element newEmail(String value) {
-    return newEmail(value, null);
-  }
-  
   public Element newEmail(Element parent) {
     return newElement(Constants.EMAIL, parent);
   }
 
-  public Element newEmail(String value, Element parent) {
-    return newElement(Constants.EMAIL, value, parent);
-  }
-
-  public Control newControl(boolean draft, Element parent) {
-    Control control = newControl(parent);
-    control.setDraft(draft);
-    return control;
-  }
-
   public Div newDiv() {
     return newDiv(null);
   }
   
   public Div newDiv(Base parent) {
-    return _newInstance(FOMDiv.class, Constants.DIV, (OMContainer)parent);
+    return _newInstance(
+      FOMDiv.class, CONSTRUCTORS[4], 
+      Constants.DIV, (OMContainer)parent, this);
   }
   
   public Div newDiv(
     QName qname,
     OMContainer parent, 
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMDiv.class, qname, parent, parserWrapper);
+      return _newInstance(FOMDiv.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
   
   public Element newElement(
     QName qname,
     OMContainer parent,
     OMXMLParserWrapper parserWrapper) {
-      return _newInstance(FOMElement.class, qname, parent, parserWrapper);
+      return _newInstance(FOMElement.class, CONSTRUCTORS[0], qname, parent, this, parserWrapper);
   }
 
   
@@ -1372,14 +686,19 @@
         if (isContent(qname)) {
           Content.Type type = (Content.Type)objecttype;
           element = (OMElement) _newInstance(
-            qclasses.get(qname), type, qname.getLocalPart(), namespace, parent);
+            qclasses.get(qname), CONSTRUCTORS[10], 
+            type, qname.getLocalPart(), namespace, parent, this);
         } else if (isText(qname)) {
           Text.Type type = (Text.Type)objecttype;
           element = (OMElement) _newInstance(
-            qclasses.get(qname), type, qname.getLocalPart(), namespace, parent);
+            qclasses.get(qname), 
+            CONSTRUCTORS[11], 
+            type, qname.getLocalPart(), 
+            namespace, parent, this);
         } else {
           element = (OMElement) _newInstance(
-            qclasses.get(qname), qname.getLocalPart(), namespace, parent);
+            qclasses.get(qname), CONSTRUCTORS[7], 
+            qname.getLocalPart(), namespace, parent, this);
         }
       } else if (parent instanceof ExtensibleElement || 
                  parent instanceof Document) {
@@ -1397,12 +716,22 @@
     if (qclasses.containsKey(qname)) {
       if (isContent(qname)) {
         Content.Type type = builder.getContentType();
-        element = (OMElement) _newInstance(qclasses.get(qname), qname, type, parent, builder);
+        element = (OMElement) _newInstance(
+          qclasses.get(qname), CONSTRUCTORS[2], 
+          qname, type, parent, this, builder);
       } else if (isText(qname)) {
         Text.Type type = builder.getTextType();
-        element = (OMElement) _newInstance(qclasses.get(qname), type, qname, parent, builder);
+        element = (OMElement) _newInstance(
+            qclasses.get(qname), CONSTRUCTORS[5], 
+            type, qname, parent, this, builder);
       } else {
-        element = (OMElement) _newInstance(qclasses.get(qname), qname, parent, builder);
+        element = (OMElement) _newInstance(
+          qclasses.get(qname), 
+          CONSTRUCTORS[0], 
+          qname, 
+          parent, 
+          this, 
+          builder);
       }
     } else if (parent instanceof ExtensibleElement || parent instanceof Document) {
       element = (OMElement) newExtensionElement(qname, parent, builder);
@@ -1433,191 +762,64 @@
     return (alternatives.containsKey(_class)) ? alternatives.get(_class) : _class;
   }
   
-  private static final Class[] CONSTRUCTOR1 = new Class[] {
-    QName.class, 
-    OMContainer.class,
-    OMFactory.class,
-    OMXMLParserWrapper.class};
-  
-  private static final Class[] CONSTRUCTOR2 = new Class[] {
-    OMContainer.class,
-    OMFactory.class
-  };
-  
-  private static final Class[] CONSTRUCTOR3 = new Class[] {
-    QName.class,
-    Content.Type.class,
-    OMContainer.class,
-    OMFactory.class,
-    OMXMLParserWrapper.class
+  private static final Class[][] CONSTRUCTORS = {
+    new Class[] {
+      QName.class, 
+      OMContainer.class,
+      OMFactory.class,
+      OMXMLParserWrapper.class},
+    new Class[] {
+      OMContainer.class,
+      OMFactory.class},
+    new Class[] {
+      QName.class,
+      Content.Type.class,
+      OMContainer.class,
+      OMFactory.class,
+      OMXMLParserWrapper.class},
+    new Class[] {
+      Content.Type.class,
+      OMContainer.class,
+      OMFactory.class}, 
+    new Class[] {
+      QName.class,
+      OMContainer.class,
+      OMFactory.class}, 
+    new Class[] {
+      Text.Type.class,
+      QName.class,
+      OMContainer.class,
+      OMFactory.class,
+      OMXMLParserWrapper.class},
+    new Class[] {
+      Text.Type.class,
+      QName.class,
+      OMContainer.class,
+      OMFactory.class},
+    new Class[] {
+      String.class, 
+      OMNamespace.class, 
+      OMContainer.class, 
+      OMFactory.class},
+    new Class[] {
+      OMFactory.class},
+    new Class[] {
+      OMFactory.class,
+      OMXMLParserWrapper.class},
+    new Class[] {
+      Content.Type.class,
+      String.class, 
+      OMNamespace.class, 
+      OMContainer.class, 
+      OMFactory.class},
+    new Class[] {
+      Text.Type.class,
+      String.class, 
+      OMNamespace.class, 
+      OMContainer.class, 
+      OMFactory.class}
   };
-
-  private static final Class[] CONSTRUCTOR4 = new Class[] {
-    Content.Type.class,
-    OMContainer.class,
-    OMFactory.class
-  }; 
-  
-  private static final Class[] CONSTRUCTOR5 = new Class[] {
-    QName.class,
-    OMContainer.class,
-    OMFactory.class
-  }; 
-  
-  private static final Class[] CONSTRUCTOR6 = new Class[] {
-    Text.Type.class,
-    QName.class,
-    OMContainer.class,
-    OMFactory.class,
-    OMXMLParserWrapper.class
-  };
-
-  private static final Class[] CONSTRUCTOR7 = new Class[] {
-    Text.Type.class,
-    QName.class,
-    OMContainer.class,
-    OMFactory.class
-  }; 
-  
-  private static final Class[] CONSTRUCTOR8 = new Class[] {
-    String.class, 
-    OMNamespace.class, 
-    OMContainer.class, 
-    OMFactory.class
-  };
-  
-  private static final Class[] CONSTRUCTOR9 = new Class[] {
-    OMFactory.class
-  };
-  
-  private static final Class[] CONSTRUCTOR10 = new Class[] {
-    OMFactory.class,
-    OMXMLParserWrapper.class
-  };
-
-  private static final Class[] CONSTRUCTOR11 = new Class[] {
-    Content.Type.class,
-    String.class, 
-    OMNamespace.class, 
-    OMContainer.class, 
-    OMFactory.class
-  };
-
-  private static final Class[] CONSTRUCTOR12 = new Class[] {
-    Text.Type.class,
-    String.class, 
-    OMNamespace.class, 
-    OMContainer.class, 
-    OMFactory.class
-  };
-  
-  @SuppressWarnings("unchecked")
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    QName qname,
-    OMContainer parent, 
-    OMXMLParserWrapper parserWrapper) {
-      Object[] args = new Object[] {qname, parent, this, parserWrapper}; 
-      return _newInstance(_class, CONSTRUCTOR1, args);
-  }
-  
-  @SuppressWarnings("unused")
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    OMContainer parent) {
-      Object[] args = new Object[] {parent, this};
-      return _newInstance(_class, CONSTRUCTOR2, args);
-  }
-  
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    QName qname,
-    Content.Type type,
-    OMContainer parent,
-    OMXMLParserWrapper parserWrapper) {
-      Object[] args = new Object[] {qname, type, parent, this, parserWrapper};
-      return _newInstance(_class, CONSTRUCTOR3, args);
-  }
-
-  @SuppressWarnings("unused")
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    Content.Type type,
-    OMContainer parent) {
-      Object[] args = new Object[] {type, parent, this};
-      return _newInstance(_class, CONSTRUCTOR4, args);
-  }
-
-  @SuppressWarnings("unused")
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    QName qname,
-    OMContainer parent) {
-      Object[] args = new Object[] {qname, parent, this};
-      return _newInstance(_class, CONSTRUCTOR5, args);
-  }
-  
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    Text.Type type,
-    QName qname,
-    OMContainer parent,
-    OMXMLParserWrapper parserWrapper) {
-      Object[] args = new Object[] {type, qname, parent, this, parserWrapper};
-      return _newInstance(_class, CONSTRUCTOR6, args);
-  }
-
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    Text.Type type,
-    QName qname,
-    OMContainer parent) {
-      Object[] args = new Object[] {type, qname, parent, this};
-      return _newInstance(_class, CONSTRUCTOR7, args);
-  }
-
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    String localPart,
-    OMNamespace namespace,
-    OMContainer parent) {
-      Object[] args = new Object[] {localPart, namespace, parent, this};
-      return _newInstance(_class, CONSTRUCTOR8, args);
-  }
-
-  private <T extends Base>T _newInstance(
-    Class<T> _class) {
-      Object[] args = new Object[] {this};
-      return _newInstance(_class, CONSTRUCTOR9, args);
-  }
-
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    OMXMLParserWrapper parserWrapper) {
-      Object[] args = new Object[] {this, parserWrapper};
-      return _newInstance(_class, CONSTRUCTOR10, args);
-  }
-  
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    Content.Type type,
-    String localPart,
-    OMNamespace namespace,
-    OMContainer parent) {
-      Object[] args = new Object[] {type, localPart, namespace, parent, this};
-      return _newInstance(_class, CONSTRUCTOR11, args);
-  }
-  
-  private <T extends Base>T _newInstance(
-    Class<T> _class,
-    Text.Type type,
-    String localPart,
-    OMNamespace namespace,
-    OMContainer parent) {
-      Object[] args = new Object[] {type, localPart, namespace, parent, this};
-      return _newInstance(_class, CONSTRUCTOR12, args);
-  }
-  
+    
   /**
    * This likely has some class loader issues we need to be concerned about
    */
@@ -1625,14 +827,16 @@
   private <T extends Base>T _newInstance(
     Class<T> _class, 
     Class[] argtypes, 
-    Object[] args) {
+    Object... args) {
     Class _altclass = _getAlternative(_class);
     try {
       return (T) _altclass.getConstructor(argtypes).newInstance(args);
     } catch (Exception e) {
       try {
         return (T) _class.getConstructor(argtypes).newInstance(args);
-      } catch (Exception ex) {}
+      } catch (Exception ex) {
+        ex.printStackTrace();
+      }
     }
     return null;
   }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java?rev=420662&r1=420661&r2=420662&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java Mon Jul 10 16:42:23 2006
@@ -115,7 +115,8 @@
   public Element setName(String name) {
     if (name != null) {
       FOMFactory fomfactory = (FOMFactory) factory;
-      Element el = fomfactory.newName(name, null);
+      Element el = fomfactory.newName(null);
+      el.setText(name);
       _setChild(NAME, (OMElement)el);
       return el;
     } else {
@@ -143,7 +144,8 @@
   public Element setEmail(String email) {
     if (email != null) {
       FOMFactory fomfactory = (FOMFactory) factory;
-      Element el = fomfactory.newEmail(email, null);
+      Element el = fomfactory.newEmail(null);
+      el.setText(email);
       _setChild(EMAIL, (OMElement)el);
       return el;
     } else {
@@ -171,7 +173,8 @@
   public IRI setUri(URI uri) {
     if (uri != null) {
       FOMFactory fomfactory = (FOMFactory) factory;
-      IRI el = fomfactory.newUri(uri, null);
+      IRI el = fomfactory.newUri(null);
+      el.setValue(uri);
       _setChild(URI, (OMElement)el);
       return el;
     } else {
@@ -183,7 +186,8 @@
   public IRI setUri(String uri) throws URISyntaxException {
     if (uri != null) {
       FOMFactory fomfactory = (FOMFactory) factory;
-      IRI el = fomfactory.newUri(uri, null);
+      IRI el = fomfactory.newUri(null);
+      el.setValue(uri);
       _setChild(URI, (OMElement)el);
       return el;
     } else {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java?rev=420662&r1=420661&r2=420662&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java Mon Jul 10 16:42:23 2006
@@ -124,16 +124,20 @@
 
   public Person addAuthor(String name, String email, String uri) throws URISyntaxException {
     FOMFactory fomfactory = (FOMFactory) this.factory;
-    Person person = fomfactory.newAuthor(name, email, uri, this);
-    addAuthor(person);
+    Person person = fomfactory.newAuthor(this);
+    person.setName(name);
+    person.setEmail(email);
+    person.setUri(uri);
     return person;
   }
   
   public Person addAuthor(String name, String email, URI uri) {
     FOMFactory fomfactory = (FOMFactory) this.factory;
-    Person person = fomfactory.newAuthor(name, email, uri, this);
-    addAuthor(person);
-    return person;    
+    Person person = fomfactory.newAuthor(this);
+    person.setName(name);
+    person.setEmail(email);
+    person.setUri(uri);
+    return person;
   }
 
   public List<Category> getCategories() {
@@ -176,12 +180,20 @@
 
   public Category addCategory(URI scheme, String term, String label) {
     FOMFactory factory = (FOMFactory) this.factory;
-    return factory.newCategory(term, scheme, label, this);
+    Category category = factory.newCategory(this);
+    category.setTerm(term);
+    category.setScheme(scheme);
+    category.setLabel(label);
+    return category;
   }
   
   public Category addCategory(String scheme, String term, String label) throws URISyntaxException {
     FOMFactory factory = (FOMFactory) this.factory;
-    return factory.newCategory(term, new URI(scheme), label, this);    
+    Category category = factory.newCategory(this);
+    category.setTerm(term);
+    category.setScheme(scheme);
+    category.setLabel(label);
+    return category;    
   }
   
   public List<Person> getContributors() {
@@ -205,12 +217,20 @@
 
   public Person addContributor(String name, String email, String uri) throws URISyntaxException {
     FOMFactory fomfactory = (FOMFactory) this.factory;
-    return fomfactory.newContributor(name, email, uri, this);
+    Person person = fomfactory.newContributor(this);
+    person.setName(name);
+    person.setEmail(email);
+    person.setUri(uri);
+    return person;
   }
   
   public Person addContributor(String name, String email, URI uri) {
     FOMFactory fomfactory = (FOMFactory) this.factory;
-    return fomfactory.newContributor(name, email, uri, this);    
+    Person person = fomfactory.newContributor(this);
+    person.setName(name);
+    person.setEmail(email);
+    person.setUri(uri);
+    return person;    
   }
   
   public IRI getIdElement() {
@@ -249,8 +269,9 @@
       return id;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newID(
-          (normalize) ? URIHelper.normalize(value) : value, this);
+      IRI iri = fomfactory.newID(this);
+      iri.setValue((normalize) ? URIHelper.normalize(value) : value);
+      return iri;
     }
   }
     
@@ -295,7 +316,10 @@
   
   public Link addLink(String href, String rel) throws URISyntaxException {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(href, rel, null, null, null, -1, this);    
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    if (rel != null) link.setRel(rel);
+    return link;    
   }
   
   public Link addLink(URI href) {
@@ -304,27 +328,58 @@
   
   public Link addLink(URI href, String rel) {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(href, rel, null, null, null, -1, this);
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    link.setRel(rel);
+    return link;
   }
   
   public Link addLink(URI href, String rel, MimeType type, String title, String hreflang, long length) {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(href, rel, type, title, hreflang, length, this);
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    link.setRel(rel);
+    link.setMimeType(type);
+    link.setTitle(title);
+    link.setHrefLang(hreflang);
+    link.setLength(length);
+    return link;
   }
   
   public Link addLink(String href, String rel, MimeType type, String title, String hreflang, long length) throws URISyntaxException {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(href, rel, type, title, hreflang, length, this);
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    link.setRel(rel);
+    link.setMimeType(type);
+    link.setTitle(title);
+    link.setHrefLang(hreflang);
+    link.setLength(length);
+    return link;
   }
   
   public Link addLink(URI href, String rel, String type, String title, String hreflang, long length) throws MimeTypeParseException {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(href, rel, new MimeType(type), title, hreflang, length, this);
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    link.setRel(rel);
+    link.setMimeType(type);
+    link.setTitle(title);
+    link.setHrefLang(hreflang);
+    link.setLength(length);
+    return link;
   }
   
   public Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws URISyntaxException, MimeTypeParseException {
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLink(href, rel, new MimeType(type), title, hreflang, length, this);
+    Link link = fomfactory.newLink(this);
+    link.setHref(href);
+    link.setRel(rel);
+    link.setMimeType(type);
+    link.setTitle(title);
+    link.setHrefLang(hreflang);
+    link.setLength(length);
+    return link;
   }
     
   @SuppressWarnings("unchecked")
@@ -345,7 +400,8 @@
   
   public Text setRights(String value) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newRights(value);
+    Text text = factory.newRights();
+    text.setValue(value);
     setRightsElement(text);
     return text;
   }
@@ -367,7 +423,8 @@
   
   public Text setRights(String value, Text.Type type) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newRights(value, type);
+    Text text = factory.newRights(type);
+    text.setValue(value);
     setRightsElement(text);
     return text;
   }
@@ -411,7 +468,8 @@
   
   public Text setSubtitle(String value) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newSubtitle(value);
+    Text text = factory.newSubtitle();
+    text.setValue(value);
     setSubtitleElement(text);
     return text;
   }
@@ -433,7 +491,8 @@
   
   public Text setSubtitle(String value, Text.Type type) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newSubtitle(value, type);
+    Text text = factory.newSubtitle(type);
+    text.setValue(value);
     setSubtitleElement(text);
     return text;
   }
@@ -466,7 +525,8 @@
   
   public Text setTitle(String value) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newTitle(value);
+    Text text = factory.newTitle();
+    text.setValue(value);
     setTitleElement(text);
     return text;
   }
@@ -488,7 +548,8 @@
   
   public Text setTitle(String value, Text.Type type) {
     FOMFactory factory = (FOMFactory)this.factory;
-    Text text = factory.newTitle(value, type);
+    Text text = factory.newTitle(type);
+    text.setValue(value);
     setTitleElement(text);
     return text;
   }
@@ -536,7 +597,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newUpdated(value, this);
+      DateTime dt = fomfactory.newUpdated(this);
+      dt.setDate(value);
+      return dt;
     }
   }
   
@@ -551,7 +614,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newUpdated(value, this);
+      DateTime dt = fomfactory.newUpdated(this);
+      dt.setCalendar(value);
+      return dt;
     }
   }
   
@@ -562,7 +627,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newUpdated(value, this);
+      DateTime dt = fomfactory.newUpdated(this);
+      dt.setTime(value);
+      return dt;
     }
   }
   
@@ -577,7 +644,9 @@
       return dte;
     } else {
       FOMFactory fomfactory = (FOMFactory) factory;
-      return fomfactory.newUpdated(value, this);
+      DateTime dt = fomfactory.newUpdated(this);
+      dt.setString(value);
+      return dt;
     }
   }
   
@@ -594,7 +663,10 @@
 
   public Generator setGenerator(URI uri, String version, String value) {
     FOMFactory fomfactory = (FOMFactory) factory;
-    Generator generator = fomfactory.newGenerator(uri, version, value, this);
+    Generator generator = fomfactory.newGenerator(this);
+    generator.setUri(uri);
+    generator.setVersion(version);
+    generator.setText(value);
     return generator;
   }
   
@@ -604,10 +676,10 @@
     String value) 
       throws URISyntaxException {
     FOMFactory fomfactory = (FOMFactory) factory;
-    Generator generator = 
-      fomfactory.newGenerator(
-        (uri != null) ? new URI(uri):null, 
-        version, value, this);
+    Generator generator = fomfactory.newGenerator(this);
+    if (uri != null) generator.setUri(new URI(uri));
+    generator.setVersion(version);
+    generator.setText(value);
     return generator;    
   }
   
@@ -622,22 +694,26 @@
       _removeElement(ICON, false);
   }
 
-  public IRI setIcon(String iri) throws URISyntaxException {
-    if (iri == null) {
+  public IRI setIcon(String value) throws URISyntaxException {
+    if (value == null) {
       _removeElement(ICON, false);
       return null;
     }
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newIcon(iri, this);
+    IRI iri = fomfactory.newIcon(this);
+    iri.setValue(value);
+    return iri;
   }
   
-  public IRI setIcon(URI iri) {
-    if (iri == null) {
+  public IRI setIcon(URI value) {
+    if (value == null) {
       _removeElement(ICON, false);
       return null;
     }
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newIcon(iri, this);    
+    IRI iri = fomfactory.newIcon(this);
+    iri.setValue(value);
+    return iri;    
   }
   
   public URI getIcon() throws URISyntaxException {
@@ -656,22 +732,26 @@
       _removeElement(LOGO, false);
   }
 
-  public IRI setLogo(String iri) throws URISyntaxException {
-    if (iri == null) {
+  public IRI setLogo(String value) throws URISyntaxException {
+    if (value == null) {
       _removeElement(LOGO, false);
       return null;
     }
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLogo(iri, this);
+    IRI iri = fomfactory.newLogo(this);
+    iri.setValue(value);
+    return iri;
   }
   
-  public IRI setLogo(URI iri) {
-    if (iri == null) {
+  public IRI setLogo(URI value) {
+    if (value == null) {
       _removeElement(LOGO, false);
       return null;
     }
     FOMFactory fomfactory = (FOMFactory) factory;
-    return fomfactory.newLogo(iri, this);    
+    IRI iri = fomfactory.newLogo(this);
+    iri.setValue(value);
+    return iri;    
   }
   
   public URI getLogo() throws URISyntaxException {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java?rev=420662&r1=420661&r2=420662&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java Mon Jul 10 16:42:23 2006
@@ -106,6 +106,7 @@
     if (value != null) {
       if (this.getFirstChildWithName(Constants.DIV) != null)
         this.getFirstChildWithName(Constants.DIV).discard();
+      init(Text.Type.XHTML);
       this.setFirstChild((OMElement)value);
     } else
       _removeAllChildren();



Mime
View raw message