abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r416512 [2/2] - in /incubator/abdera: java/trunk/core/src/main/java/org/apache/abdera/factory/ java/trunk/core/src/main/java/org/apache/abdera/model/ java/trunk/examples/src/main/java/org/apache/abdera/examples/appclient/ java/trunk/example...
Date Thu, 22 Jun 2006 23:34:09 GMT
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=416512&r1=416511&r2=416512&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 Thu Jun 22 16:34:07 2006
@@ -62,6 +62,7 @@
 import org.apache.abdera.model.Content.Type;
 import org.apache.abdera.parser.Parser;
 import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.abdera.util.Version;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
@@ -152,6 +153,10 @@
       return _newInstance(FOMWorkspace.class, qname, parent, parserWrapper);
   }
   
+  public Workspace newWorkspace() {
+    return newWorkspace(null);
+  }
+  
   public Workspace newWorkspace(
     Element parent) {
       return _newInstance(FOMWorkspace.class, (OMContainer)parent);
@@ -164,6 +169,10 @@
       return _newInstance(FOMCollection.class, qname, parent, parserWrapper);
   }
   
+  public Collection newCollection() {
+    return newCollection(null);
+  }
+  
   public Collection newCollection(
     Element parent) {
       return _newInstance(FOMCollection.class, (OMContainer)parent);
@@ -215,14 +224,33 @@
       return _newInstance(FOMCategory.class, qname, parent, parserWrapper);
   }
   
+  public Category newCategory() {
+    return newCategory((Element)null);
+  }
+  
   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);
@@ -244,6 +272,19 @@
       return _newInstance(FOMContent.class, qname, type, parent, 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);
+  }
+  
   public Content newContent(
     Type type, 
     Element parent) {
@@ -251,62 +292,100 @@
       return _newInstance(FOMContent.class, type, (OMContainer)parent);
   }
   
-  public Content newHtmlContent(
+  public Content newContent(MimeType mediaType) {
+    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(Content.Type type, ExtensionElement value) {
+    return newContent(value, type, null);
+  }
+  
+  public Content newContent(ExtensionElement 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(Content.Type.HTML, parent);
-      content.setValue(value);
-      return content;
+    Content content = newContent(mediaType, parent);
+    content.setValue(value);
+    return content;
   }
-
-  public Content newMediaContent(
-    MimeType mediaType, 
-    URI src, 
+  
+  public Content newContent(
     DataHandler dataHandler, 
-    Element parent) {
-      Content content = newContent(Content.Type.MEDIA, mediaType, parent);
-      if (src != null) content.setSrc(src);
-      if (dataHandler != null) content.setDataHandler(dataHandler);
-      return content;
+    MimeType mediaType) { 
+      return newContent(dataHandler, mediaType, null);
   }
-
-  public Content newTextContent(
-    String value, 
+  
+  public Content newContent(
+    DataHandler dataHandler, 
+    MimeType mediaType, 
     Element parent) {
-      Content content = newContent(Content.Type.TEXT, parent);
-      content.setValue(value);
+      Content content = newContent(mediaType, parent);
+      if (dataHandler != null)
+        content.setDataHandler(dataHandler);
+      if (mediaType != null)
+        content.setMimeType(mediaType);
       return content;
   }
 
-  public Content newXhtmlContent(
-    Div value, Element parent) {
-      Content content = 
-        newContent(
-          Content.Type.XHTML, 
-          parent);
-      if (value != null)
-        content.setValueElement(value);
-      return content;
+  public Content newContent(
+    ExtensionElement value, 
+    MimeType mediaType) {
+      return newContent(value, mediaType, null);
   }
-
-  public Content newXmlContent(
+  
+  public Content newContent(
+    ExtensionElement value, 
     MimeType mediaType, 
-    URI src, 
-    ExtensionElement value, Element parent) {
+    Element parent) {
       Content content = 
         newContent(
-          Content.Type.XML, 
           mediaType, 
           parent);
-      if (src != null) content.setSrc(src);
-      if (value != null) content.setValueElement(value);
+      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(
-    Type type, 
     MimeType mediaType, 
     Element parent) {
+    Content.Type type = 
+      (MimeTypeHelper.isXml(mediaType.toString())) ? 
+         Content.Type.XML : Content.Type.MEDIA;
     Content content = newContent(type, parent);
     content.setMimeType(mediaType);
     return content;
@@ -377,6 +456,10 @@
       return _newInstance(FOMGenerator.class, qname, parent, parserWrapper);
   }
   
+  public Generator newDefaultGenerator() {
+    return newDefaultGenerator(null);
+  }
+  
   public Generator newDefaultGenerator(
     Element parent) {
       Generator generator = newGenerator(parent);
@@ -388,6 +471,10 @@
       return generator;
   }
   
+  public Generator newGenerator() {
+    return newGenerator(null);
+  }
+  
   public Generator newGenerator(
       Element parent) {
     return _newInstance(FOMGenerator.class, (OMContainer)parent);
@@ -396,6 +483,13 @@
   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);
@@ -415,6 +509,18 @@
       return _newInstance(FOMIRI.class, qname, parent, 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);
@@ -480,6 +586,31 @@
       return _newInstance(FOMLink.class, qname, parent, parserWrapper);
   }
   
+  public Link newLink() {
+    return newLink((Element)null);
+  }
+  
+  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);
@@ -585,6 +716,10 @@
       return _newInstance(FOMSource.class, qname, parent, parserWrapper);
   }
   
+  public Source newSource() {
+    return newSource((Element)null);
+  }
+  
   public Source newSource(
       Element parent) {
     return _newInstance(FOMSource.class, (OMContainer)parent);
@@ -600,6 +735,12 @@
   }
   
   public Text newText(
+    QName qname,
+    Text.Type type) {
+    return newText(qname, type, (Element)null);
+  }
+  
+  public Text newText(
     QName qname, 
     Text.Type type, 
     Element parent) {
@@ -607,25 +748,30 @@
     return _newInstance(FOMText.class,type, qname,(OMContainer)parent);
   }
   
-  public Text newHtmlText(
+  public Text newText(
     QName qname, 
-    String value, 
-    Element parent) {
-      Text text = newText(qname, Text.Type.HTML, parent);
-      text.setValue(value);
-      return text;
+    String value,
+    Text.Type type) {
+      return newText(qname, value, type, null);
   }
-
-  public Text newTextText(
+  
+  public Text newText(
     QName qname, 
-    String value, 
+    String value,
+    Text.Type type,
     Element parent) {
-      Text text = newText(qname, Text.Type.TEXT, parent);
+      Text text = newText(qname, type, parent);
       text.setValue(value);
       return text;
   }
 
-  public Text newXhtmlText(
+  public Text newText(
+    QName qname,
+    Div value) {
+    return newText(qname, value, null);
+  }
+  
+  public Text newText(
     QName qname, 
     Div value,
     Element parent) {
@@ -642,6 +788,14 @@
       return _newInstance(FOMStringElement.class, qname, parent, parserWrapper);
   }
   
+  public StringElement newStringElement(QName qname) {
+    return newStringElement(qname, (Element)null);
+  }
+  
+  public StringElement newStringElement(QName qname, String value) {
+    return newStringElement(qname, value, null);
+  }
+  
   public StringElement newStringElement(
     QName qname, 
     Base parent) {
@@ -658,6 +812,10 @@
     return el;
   }
 
+  public ExtensionElement newExtensionElement(QName qname) {
+    return newExtensionElement(qname, (Base)null);
+  }
+  
   public ExtensionElement newExtensionElement(
     QName qname, 
     Base parent) {
@@ -705,6 +863,14 @@
     return element;
   }
   
+  public Control newControl() {
+    return newControl((Element)null);
+  }
+   
+  public Control newControl(boolean draft) {
+    return newControl(draft, null);
+  }
+  
   public Control newControl(Element parent) {
     return _newInstance(FOMControl.class, (OMContainer)parent);
   }
@@ -716,6 +882,30 @@
       return _newInstance(FOMControl.class, qname, parent, 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);
   }
@@ -740,6 +930,30 @@
     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);
   }
@@ -764,6 +978,18 @@
     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);
   }
@@ -776,6 +1002,18 @@
     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);
   }
@@ -788,6 +1026,18 @@
     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);
   }
@@ -800,80 +1050,255 @@
     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 {
+  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 newAuthor(
+    String name, 
+    String email, 
+    URI uri, 
+    Element parent) {
+      return newPerson(Constants.AUTHOR, name, email, uri, parent);
   }
 
-  public Person newContributor(Element parent) {
-    return newPerson(Constants.CONTRIBUTOR, parent);
+  public Person newContributor() {
+    return newContributor((Element)null);
   }
 
-  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, 
+    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, URI uri, Element parent) {
+  public Person newContributor(
+    String name, 
+    String email, 
+    String uri, 
+    Element parent) 
+      throws URISyntaxException {
     return newPerson(Constants.CONTRIBUTOR, name, email, uri, parent);
   }
 
-  public Text newTextTitle(String value, Element parent) {
-    return newTextText(Constants.TITLE, value, parent);
+  public Person newContributor(
+    String name, 
+    String email, 
+    URI uri, 
+    Element parent) {
+      return newPerson(Constants.CONTRIBUTOR, name, email, uri, parent);
   }
 
-  public Text newHtmlTitle(String value, Element parent) {
-    return newHtmlText(Constants.TITLE, value, parent);
+  public Text newTitle() {
+    return newTitle(Text.Type.TEXT);
   }
-
-  public Text newXhtmlTitle(
+  
+  public Text newTitle(String value) {
+    return newTitle(value, Text.Type.TEXT);
+  }
+  
+  public Text newTitle(Element parent) {
+    return newTitle(Text.Type.TEXT, parent);
+  }
+  
+  public Text newTitle(Text.Type type) {
+    return newTitle(type, (Element)null);
+  }
+  
+  public Text newTitle(Text.Type type, Element parent) {
+    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 newXhtmlText(Constants.TITLE, value, parent);
+      return newText(Constants.TITLE, value, parent);
   }
 
-  public Text newTextSubtitle(String value, Element parent) {
-    return newTextText(Constants.SUBTITLE, value, parent);
+  public Text newSubtitle() {
+    return newSubtitle(Text.Type.TEXT);
   }
-
-  public Text newHtmlSubtitle(String value, Element parent) {
-    return newHtmlText(Constants.SUBTITLE, value, parent);
+  
+  public Text newSubtitle(String value) {
+    return newSubtitle(value, Text.Type.TEXT);
   }
-
-  public Text newXhtmlSubtitle(Div value, Element parent) {
-    return newXhtmlText(Constants.SUBTITLE, value, parent);
+  
+  public Text newSubtitle(Element parent) {
+    return newSubtitle(Text.Type.TEXT, parent);
   }
-
-  public Text newTextSummary(String value, Element parent) {
-    return newTextText(Constants.SUMMARY, value, parent);
+  
+  public Text newSubtitle(Text.Type type) {
+    return newSubtitle(type, (Element)null);
   }
-
-  public Text newHtmlSummary(String value, Element parent) {
-    return newHtmlText(Constants.SUMMARY, value, parent);
+  
+  public Text newSubtitle(Text.Type type, Element parent) {
+    return newText(Constants.SUBTITLE, type, parent);
   }
-
-  public Text newXhtmlSummary(Div value, Element parent) {
-    return newXhtmlText(Constants.SUMMARY, value, parent);
+  
+  public Text newSubtitle(String value, Text.Type type) {
+    return newSubtitle(value, type, null);
   }
-
-  public Text newTextRights(String value, Element parent) {
-    return newTextText(Constants.RIGHTS, value, parent);
+  
+  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 newHtmlRights(String value, Element parent) {
-    return newHtmlText(Constants.RIGHTS, 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);
+  }
+  
+  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 newXhtmlRights(Div value, Element parent) {
-    return newXhtmlText(Constants.RIGHTS, 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);
+  }
+  
+  public Text newRights(Text.Type type) {
+    return newRights(type, (Element)null);
+  }
+  
+  public Text newRights(Text.Type type, Element parent) {
+    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 StringElement newName() {
+    return newName((Element)null);
+  }
+  
+  public StringElement newName(String value) {
+    return newName(value, null);
+  }
+  
   public StringElement newName(Element parent) {
     return newStringElement(Constants.NAME, parent);
   }
@@ -882,6 +1307,14 @@
     return newStringElement(Constants.NAME, value, parent);
   }
 
+  public StringElement newEmail() {
+    return newEmail((Element)null);
+  }
+  
+  public StringElement newEmail(String value) {
+    return newEmail(value, null);
+  }
+  
   public StringElement newEmail(Element parent) {
     return newStringElement(Constants.EMAIL, parent);
   }
@@ -896,6 +1329,10 @@
     return control;
   }
 
+  public Div newDiv() {
+    return newDiv(null);
+  }
+  
   public Div newDiv(Base parent) {
     return _newInstance(FOMDiv.class, Constants.DIV, (OMContainer)parent);
   }
@@ -914,6 +1351,14 @@
       return _newInstance(FOMElement.class, qname, parent, parserWrapper);
   }
 
+  public Total newTotal() {
+    return newTotal((Element)null);
+  }
+  
+  public Total newTotal(int totalResponse) {
+    return newTotal(totalResponse, null);
+  }
+  
   public Total newTotal(Element parent) {
     return _newInstance(FOMTotal.class, (OMContainer)parent);
   }
@@ -931,6 +1376,38 @@
     return _newInstance(FOMTotal.class, qname, parent, parserWrapper);
   }
   
+  public InReplyTo newInReplyTo() {
+    return newInReplyTo((Element)null);
+  }
+  
+  public InReplyTo newInReplyTo(URI ref) {
+    return newInReplyTo(ref, null);
+  }
+  
+  public InReplyTo newInReplyTo(
+    String ref) 
+      throws URISyntaxException {
+    return newInReplyTo(ref, null);
+  }
+  
+  public InReplyTo newInReplyTo(
+    URI ref, 
+    URI source, 
+    URI href, 
+    MimeType type) {
+      return newInReplyTo(ref, source, href, type, null);
+  }
+  
+  public InReplyTo newInReplyTo(
+    String ref, 
+    String source, 
+    String href, 
+    String type) 
+      throws URISyntaxException, 
+             MimeTypeParseException {
+    return newInReplyTo(ref, source, href, type, null);
+  }
+  
   public InReplyTo newInReplyTo(
     QName qname,
     OMContainer parent, 
@@ -1008,16 +1485,21 @@
       if (qclasses.containsKey(qname)) {
         if (isContent(qname)) {
           Content.Type type = (Content.Type)objecttype;
-          element = (OMElement) _newInstance(qclasses.get(qname), type, qname.getLocalPart(), namespace, parent);
+          element = (OMElement) _newInstance(
+            qclasses.get(qname), type, qname.getLocalPart(), namespace, parent);
         } else if (isText(qname)) {
           Text.Type type = (Text.Type)objecttype;
-          element = (OMElement) _newInstance(qclasses.get(qname), type, qname.getLocalPart(), namespace, parent);
+          element = (OMElement) _newInstance(
+            qclasses.get(qname), type, qname.getLocalPart(), namespace, parent);
         } else {
-          element = (OMElement) _newInstance(qclasses.get(qname), qname.getLocalPart(), namespace, parent);
+          element = (OMElement) _newInstance(
+            qclasses.get(qname), qname.getLocalPart(), namespace, parent);
         }
-      } else if (parent instanceof ExtensibleElement || parent instanceof Document) {
+      } else if (parent instanceof ExtensibleElement || 
+                 parent instanceof Document) {
         if (isSimpleExtension(qname)) {
-          element = (OMElement) _newInstance(FOMStringElement.class, qname.getLocalPart(), namespace, parent);
+          element = (OMElement) _newInstance(
+            FOMStringElement.class, qname.getLocalPart(), namespace, parent);
         } else {
           element = (OMElement) newExtensionElement(qname, parent);
         }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java Thu Jun 22 16:34:07 2006
@@ -22,9 +22,11 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Entry;
 import org.apache.abdera.model.Feed;
 import org.apache.abdera.model.Source;
+import org.apache.abdera.util.Constants;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -38,6 +40,10 @@
   implements Feed {
   
   private static final long serialVersionUID = 4552921210185524535L;
+  
+  public FOMFeed() {
+    super(Constants.FEED, null, (OMFactory)Factory.INSTANCE);
+  }
   
   public FOMFeed(
     String name,

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMGenerator.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMGenerator.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMGenerator.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMGenerator.java Thu Jun 22 16:34:07 2006
@@ -22,7 +22,9 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Generator;
+import org.apache.abdera.util.Constants;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -36,6 +38,31 @@
   
   private static final long serialVersionUID = -8441971633807437976L;
 
+  public FOMGenerator() {
+    super(Constants.GENERATOR, null, (OMFactory)Factory.INSTANCE);
+  }
+  
+  public FOMGenerator(
+    String value, 
+    String version, 
+    URI uri) {
+      this();
+      setValue(value);
+      setVersion(version);
+      setUri(uri);
+  }
+
+  public FOMGenerator(
+    String value, 
+    String version, 
+    String uri) 
+      throws URISyntaxException {
+    this();
+    setValue(value);
+    setVersion(version);
+    setUri(uri);
+  }
+  
   public FOMGenerator(
       String name,
       OMNamespace namespace,

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMIRI.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMIRI.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMIRI.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMIRI.java Thu Jun 22 16:34:07 2006
@@ -22,6 +22,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.IRI;
 import org.apache.abdera.util.URIHelper;
 import org.apache.axiom.om.OMContainer;
@@ -37,6 +38,20 @@
 
   private static final long serialVersionUID = -8434722753544181200L;
 
+  public FOMIRI(QName qname) {
+    super(qname, null, (OMFactory)Factory.INSTANCE);
+  }
+  
+  public FOMIRI(QName qname, URI value) {
+    this(qname);
+    setValue(value);
+  }
+
+  public FOMIRI(QName qname, String value) throws URISyntaxException {
+    this(qname);
+    setValue(value);
+  }
+  
   public FOMIRI(
     String name,
     OMNamespace namespace,

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMInReplyTo.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMInReplyTo.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMInReplyTo.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMInReplyTo.java Thu Jun 22 16:34:07 2006
@@ -24,6 +24,7 @@
 import javax.activation.MimeTypeParseException;
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.InReplyTo;
 import org.apache.abdera.util.Constants;
 import org.apache.axiom.om.OMContainer;
@@ -39,6 +40,20 @@
 
   private static final long serialVersionUID = 7805672826003392693L;
 
+  public FOMInReplyTo() {
+    super(Constants.IN_REPLY_TO, null, (OMFactory)Factory.INSTANCE);
+  }
+  
+  public FOMInReplyTo(URI ref) {
+    this();
+    setRef(ref);
+  }
+  
+  public FOMInReplyTo(String ref) throws URISyntaxException {
+    this();
+    setRef(ref);
+  }
+  
   public FOMInReplyTo(
     String name,
     OMNamespace namespace,

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMLink.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMLink.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMLink.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMLink.java Thu Jun 22 16:34:07 2006
@@ -26,7 +26,9 @@
 import javax.activation.MimeTypeParseException;
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Link;
+import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.URIHelper;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
@@ -41,6 +43,39 @@
 
   private static final long serialVersionUID = 2239772197929910635L;
 
+  public FOMLink() {
+    super(Constants.LINK, null, (OMFactory)Factory.INSTANCE);
+  }
+  
+  public FOMLink(URI href) {
+    this();
+    setHref(href);
+  }
+  
+  public FOMLink(
+    String href) 
+      throws URISyntaxException {
+    this();
+    setHref(href);
+  }
+  
+  public FOMLink(
+    URI href, 
+    String rel) {
+      this();
+      setHref(href);
+      setRel(rel);
+  }
+  
+  public FOMLink(
+    String href, 
+    String rel) 
+      throws URISyntaxException {
+    this();
+    setHref(href);
+    setRel(rel);
+  }
+  
   public FOMLink(
     String name,
     OMNamespace namespace,

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=416512&r1=416511&r2=416512&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 Thu Jun 22 16:34:07 2006
@@ -22,6 +22,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.IRI;
 import org.apache.abdera.model.Person;
 import org.apache.abdera.model.StringElement;
@@ -38,6 +39,40 @@
   implements Person {
 
   private static final long serialVersionUID = 2147684807662492625L; 
+  
+  public FOMPerson(QName qname) { 
+    super(qname, null, (OMFactory)Factory.INSTANCE);
+  }
+  
+  public FOMPerson(
+    QName qname, 
+    String name) {
+      this(qname);
+      setName(name);
+  }
+  
+  public FOMPerson(
+    QName qname, 
+    String name, 
+    String email, 
+    URI uri) {
+      this(qname);
+      setName(name);
+      setEmail(email);
+      setUri(uri);
+  }
+
+  public FOMPerson(
+    QName qname, 
+    String name, 
+    String email, 
+    String uri) 
+      throws URISyntaxException {
+    this(qname);
+    setName(name);
+    setEmail(email);
+    setUri(uri);
+  }
   
   public FOMPerson(
     String name,

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java Thu Jun 22 16:34:07 2006
@@ -21,9 +21,11 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Collection;
 import org.apache.abdera.model.Service;
 import org.apache.abdera.model.Workspace;
+import org.apache.abdera.util.Constants;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -38,6 +40,10 @@
  
   private static final long serialVersionUID = 7982751563668891240L;
 
+  public FOMService() {
+    super(Constants.SERVICE, null, (OMFactory)Factory.INSTANCE);
+  }
+  
   public FOMService(
     String name,
     OMNamespace namespace,

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=416512&r1=416511&r2=416512&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 Thu Jun 22 16:34:07 2006
@@ -28,6 +28,7 @@
 import javax.activation.MimeTypeParseException;
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Category;
 import org.apache.abdera.model.DateTime;
 import org.apache.abdera.model.Div;
@@ -37,6 +38,7 @@
 import org.apache.abdera.model.Person;
 import org.apache.abdera.model.Source;
 import org.apache.abdera.model.Text;
+import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.URIHelper;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
@@ -52,6 +54,10 @@
 
   private static final long serialVersionUID = 9153127297531238021L; 
   
+  public FOMSource() {
+    super(Constants.SOURCE, null, (OMFactory)Factory.INSTANCE);
+  }
+  
   public FOMSource(
     String name,
     OMNamespace namespace,
@@ -170,12 +176,12 @@
 
   public Category addCategory(URI scheme, String term, String label) {
     FOMFactory factory = (FOMFactory) this.factory;
-    return factory.newCategory(scheme, term, label, this);
+    return factory.newCategory(term, scheme, label, this);
   }
   
   public Category addCategory(String scheme, String term, String label) throws URISyntaxException {
     FOMFactory factory = (FOMFactory) this.factory;
-    return factory.newCategory(new URI(scheme), term, label, this);    
+    return factory.newCategory(term, new URI(scheme), label, this);    
   }
   
   public List<Person> getContributors() {
@@ -330,22 +336,49 @@
     setTextElement(RIGHTS, text, false);
   }
 
-  public Text setRightsAsText(String value) {
-    return setTextText(RIGHTS, value);
-  }  
+  public Text setRights() {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newRights(Text.Type.TEXT);
+    setRightsElement(text);
+    return text;
+  }
+  
+  public Text setRights(String value) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newRights(value);
+    setRightsElement(text);
+    return text;
+  }
   
-  public Text setRightsAsHtml(String value, URI baseUri) {
-    return setHtmlText(RIGHTS, value, baseUri);
+  public Text setRightsAsHtml(String value) {
+    return setRights(value, Text.Type.HTML);
+  }
+  
+  public Text setRightsAsXhtml(String value) {
+    return setRights(value, Text.Type.XHTML);
   }
   
-  public Text setRightsAsXhtml(String value, URI baseUri) {
-    return setXhtmlText(RIGHTS, value, baseUri);
+  public Text setRights(Text.Type type) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newRights(type);
+    setRightsElement(text);
+    return text;
   }
   
-  public Text setRightsAsXhtml(Div value, URI baseUri) {
-    return setXhtmlText(RIGHTS, value, baseUri);
+  public Text setRights(String value, Text.Type type) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newRights(value, type);
+    setRightsElement(text);
+    return text;
   }
   
+  public Text setRights(Div value) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newRights(value);
+    setRightsElement(text);
+    return text;
+  }
+
   public String getRights() {
     return getText(RIGHTS);
   }
@@ -369,22 +402,49 @@
     setTextElement(SUBTITLE, text, false);
   }
 
-  public Text setSubtitleAsText(String value) {
-    return setTextText(SUBTITLE, value);
-  }  
+  public Text setSubtitle() {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newSubtitle(Text.Type.TEXT);
+    setSubtitleElement(text);
+    return text;
+  }
+  
+  public Text setSubtitle(String value) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newSubtitle(value);
+    setSubtitleElement(text);
+    return text;
+  }
   
-  public Text setSubtitleAsHtml(String value, URI baseUri) {
-    return setHtmlText(SUBTITLE, value, baseUri);
+  public Text setSubtitleAsHtml(String value) {
+    return setSubtitle(value, Text.Type.HTML);
+  }
+  
+  public Text setSubtitleAsXhtml(String value) {
+    return setSubtitle(value, Text.Type.XHTML);
   }
   
-  public Text setSubtitleAsXhtml(String value, URI baseUri) {
-    return setXhtmlText(SUBTITLE, value, baseUri);
+  public Text setSubtitle(Text.Type type) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newSubtitle(type);
+    setSubtitleElement(text);
+    return text;
   }
   
-  public Text setSubtitleAsXhtml(Div value, URI baseUri) {
-    return setXhtmlText(SUBTITLE, value, baseUri);
+  public Text setSubtitle(String value, Text.Type type) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newSubtitle(value, type);
+    setSubtitleElement(text);
+    return text;
   }
   
+  public Text setSubtitle(Div value) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newSubtitle(value);
+    setSubtitleElement(text);
+    return text;
+  }
+
   public String getSubtitle() {
     return getText(SUBTITLE);
   }
@@ -397,22 +457,49 @@
     setTextElement(TITLE, text, false);
   }
 
-  public Text setTitleAsText(String value) {
-    return setTextText(TITLE, value);
-  }  
+  public Text setTitle() {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newTitle(Text.Type.TEXT);
+    setTitleElement(text);
+    return text;
+  }
+  
+  public Text setTitle(String value) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newTitle(value);
+    setTitleElement(text);
+    return text;
+  }
   
-  public Text setTitleAsHtml(String value, URI baseUri) {
-    return setHtmlText(TITLE, value, baseUri);
+  public Text setTitleAsHtml(String value) {
+    return setTitle(value, Text.Type.HTML);
+  }
+  
+  public Text setTitleAsXhtml(String value) {
+    return setTitle(value, Text.Type.XHTML);
   }
   
-  public Text setTitleAsXhtml(String value, URI baseUri) {
-    return setXhtmlText(TITLE, value, baseUri);
+  public Text setTitle(Text.Type type) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newTitle(type);
+    setTitleElement(text);
+    return text;
   }
   
-  public Text setTitleAsXhtml(Div value, URI baseUri) {
-    return setXhtmlText(TITLE, value, baseUri);
+  public Text setTitle(String value, Text.Type type) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newTitle(value, type);
+    setTitleElement(text);
+    return text;
   }
   
+  public Text setTitle(Div value) {
+    FOMFactory factory = (FOMFactory)this.factory;
+    Text text = factory.newTitle(value);
+    setTitleElement(text);
+    return text;
+  }
+
   public String getTitle() {
     return getText(TITLE);
   }
@@ -620,78 +707,6 @@
   public Text.Type getTitleType() {
     Text text = getTitleElement();
     return (text != null) ? text.getTextType() : null;
-  }
-
-  public Text setRightsAsHtml(String value, String baseUri) throws URISyntaxException {
-    return setRightsAsHtml(value, (baseUri != null) ? new URI(baseUri): null);
-  }
-
-  public Text setRightsAsXhtml(String value, String baseUri) throws URISyntaxException {
-    return setRightsAsXhtml(value, (baseUri != null) ? new URI(baseUri): null);
-  }
-
-  public Text setRightsAsXhtml(Div value, String baseUri) throws URISyntaxException {
-    return setRightsAsXhtml(value, (baseUri != null) ? new URI(baseUri): null);
-  }
-
-  public Text setSubtitleAsHtml(String value, String baseUri) throws URISyntaxException {
-    return setSubtitleAsHtml(value, (baseUri != null) ? new URI(baseUri): null);
-  }
-
-  public Text setSubtitleAsXhtml(String value, String baseUri) throws URISyntaxException {
-    return setSubtitleAsXhtml(value, (baseUri != null) ? new URI(baseUri): null);
-  }
-
-  public Text setSubtitleAsXhtml(Div value, String baseUri) throws URISyntaxException {
-    return setSubtitleAsXhtml(value, (baseUri != null) ? new URI(baseUri): null);
-  }
-
-  public Text setTitleAsHtml(String value, String baseUri) throws URISyntaxException {
-    return setTitleAsHtml(value, (baseUri != null) ? new URI(baseUri): null);
-  }
-
-  public Text setTitleAsXhtml(String value, String baseUri) throws URISyntaxException {
-    return setTitleAsXhtml(value, (baseUri != null) ? new URI(baseUri): null);
-  }
-
-  public Text setTitleAsXhtml(Div value, String baseUri) throws URISyntaxException {
-    return setTitleAsXhtml(value, (baseUri != null) ? new URI(baseUri): null);
-  }
-
-  public Text setRightsAsHtml(String value) {
-    return setRightsAsHtml(value, (URI)null);
-  }
-
-  public Text setRightsAsXhtml(String value) {
-    return setRightsAsXhtml(value, (URI)null);
-  }
-
-  public Text setRightsAsXhtml(Div value) {
-    return setRightsAsXhtml(value, (URI)null);
-  }
-
-  public Text setSubtitleAsHtml(String value) {
-    return setSubtitleAsHtml(value, (URI)null);
-  }
-
-  public Text setSubtitleAsXhtml(String value) {
-    return setSubtitleAsXhtml(value, (URI)null);
-  }
-
-  public Text setSubtitleAsXhtml(Div value) {
-    return setSubtitleAsXhtml(value, (URI)null);
-  }
-
-  public Text setTitleAsHtml(String value) {
-    return setTitleAsHtml(value, (URI)null);
-  }
-
-  public Text setTitleAsXhtml(String value) {
-    return setTitleAsXhtml(value, (URI)null);
-  }
-
-  public Text setTitleAsXhtml(Div value) {
-    return setTitleAsXhtml(value, (URI)null);
   }
 
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMStringElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMStringElement.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMStringElement.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMStringElement.java Thu Jun 22 16:34:07 2006
@@ -19,6 +19,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.StringElement;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
@@ -33,6 +34,15 @@
 
   private static final long serialVersionUID = -4891944959471875583L;
 
+  public FOMStringElement(QName qname) {
+    super(qname, null, (OMFactory)Factory.INSTANCE);
+  }
+  
+  public FOMStringElement(QName qname, String value) {
+    this(qname);
+    setValue(value);
+  }
+  
   public FOMStringElement(
     String name,
     OMNamespace namespace,

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=416512&r1=416511&r2=416512&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 Thu Jun 22 16:34:07 2006
@@ -21,6 +21,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Div;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.Text;
@@ -40,6 +41,11 @@
   private static final long serialVersionUID = 5177795905116574120L;
   protected Type type = null;
   
+  public FOMText(QName qname, Text.Type type) {
+    super(qname, null, (OMFactory)Factory.INSTANCE);
+    init(type);
+  }
+  
   public FOMText(
     Type type,
     String name,
@@ -80,12 +86,18 @@
       _setAttributeValue(TYPE, "html");
     else if (Type.XHTML.equals(type))
       _setAttributeValue(TYPE, "xhtml");
+    else 
+      _removeAttribute(TYPE);
   }
   
   public final Type getTextType() {
     return type;
   }
 
+  public void setTextType(Type type) {
+    init(type);
+  }
+  
   public Div getValueElement() {
     return (Div)this.getFirstChildWithName(Constants.DIV);
   }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTotal.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTotal.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTotal.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTotal.java Thu Jun 22 16:34:07 2006
@@ -2,6 +2,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Total;
 import org.apache.abdera.util.Constants;
 import org.apache.axiom.om.OMContainer;
@@ -14,6 +15,10 @@
 
   private static final long serialVersionUID = 241599118592917827L;
 
+  public FOMTotal() {
+    super(Constants.THRTOTAL, null, (OMFactory)Factory.INSTANCE);
+  }
+  
   public FOMTotal(
     String name,
     OMNamespace namespace,

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java Thu Jun 22 16:34:07 2006
@@ -23,8 +23,10 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Collection;
 import org.apache.abdera.model.Workspace;
+import org.apache.abdera.util.Constants;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -39,6 +41,15 @@
 
   private static final long serialVersionUID = -421749865550509424L; 
 
+  public FOMWorkspace() {
+    super(Constants.WORKSPACE, null, (OMFactory)Factory.INSTANCE);
+  }
+  
+  public FOMWorkspace(String title) {
+    this();
+    setTitle(title);
+  }
+  
   public FOMWorkspace(
     String name,
     OMNamespace namespace,

Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java (original)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java Thu Jun 22 16:34:07 2006
@@ -119,7 +119,7 @@
     feed.setLanguage("en-US");
     feed.setBaseUri("http://example.org");
     
-    feed.setTitleAsText("Example Feed");
+    feed.setTitle("Example Feed");
     feed.addLink("http://example.org/");
     feed.addAuthor("John Doe");
     feed.setId("urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", false);
@@ -127,16 +127,16 @@
     feed.addCategory("example");
     
     Entry entry = feed.insertEntry();
-    entry.setTitleAsText("Atom-Powered Robots Run Amok");
+    entry.setTitle("Atom-Powered Robots Run Amok");
     entry.addLink("http://example.org/2003/12/13/atom03");
     entry.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", false);
-    entry.setSummaryAsText("Some text.");
+    entry.setSummary("Some text.");
     
     Entry entry2 = feed.insertEntry();
-    entry2.setTitleAsText("re: Atom-Powered Robots Run Amok");
+    entry2.setTitle("re: Atom-Powered Robots Run Amok");
     entry2.addLink("/2003/12/13/atom03/1");
     entry2.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b", false);
-    entry2.setSummaryAsText("A response");
+    entry2.setSummary("A response");
     entry2.addInReplyTo(entry);
     
     String compare = "<?xml version='1.0' encoding='UTF-8'?><a:feed xmlns:a=\"http://www.w3.org/2005/Atom\" xml:base=\"http://example.org\" xml:lang=\"en-US\"><a:title type=\"text\">Example Feed</a:title><a:link href=\"http://example.org/\" /><a:author><a:name>John Doe</a:name></a:author><a:id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</a:id><a:contributor><a:name>Bob Jones</a:name></a:contributor><a:category term=\"example\" /><a:entry><a:title type=\"text\">re: Atom-Powered Robots Run Amok</a:title><a:link href=\"/2003/12/13/atom03/1\" /><a:id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b</a:id><a:summary type=\"text\">A response</a:summary><thr:in-reply-to xmlns:thr=\"http://purl.org/syndication/thread/1.0\" href=\"http://example.org/2003/12/13/atom03\" ref=\"urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a\" /></a:entry><a:entry><a:title type=\"text\">Atom-Powered Robots Run Amok</a:title><a:link href=\"http://example.org/2003/12/13/atom03\" /><a:id>urn:uuid:1225c695-cfb
 8-4ebb-aaaa-80da344efa6a</a:id><a:summary type=\"text\">Some text.</a:summary></a:entry></a:feed>";
@@ -289,56 +289,56 @@
   
   public void testFactory() throws Exception {
     Factory factory = Factory.INSTANCE;
-    Person author = factory.newAuthor(null);
+    Person author = factory.newAuthor();
     assertNotNull(author);
-    author = factory.newAuthor("a", "b", "c", null);
+    author = factory.newAuthor("a", "b", "c");
     assertNotNull(author);
     assertEquals(author.getName(),"a");
     assertEquals(author.getEmail(), "b");
     assertEquals(author.getUri().toString(), "c");
-    author = factory.newAuthor("a", "b", new URI("c"), null);
+    author = factory.newAuthor("a", "b", new URI("c"));
     assertNotNull(author);
     assertEquals(author.getName(),"a");
     assertEquals(author.getEmail(), "b");
     assertEquals(author.getUri().toString(), "c");
-    Category category = factory.newCategory(null);
+    Category category = factory.newCategory();
     assertNotNull(category);
-    category = factory.newCategory(new URI("a"), "b", "c", null);
+    category = factory.newCategory("b", new URI("a"), "c");
     assertNotNull(category);
     assertEquals(category.getScheme().toString(), "a");
     assertEquals(category.getTerm(), "b");
     assertEquals(category.getLabel(), "c");
-    Collection collection = factory.newCollection(null);
+    Collection collection = factory.newCollection();
     assertNotNull(collection);
-    Content content = factory.newContent(Content.Type.TEXT, null);
+    Content content = factory.newContent(Content.Type.TEXT);
     assertNotNull(content);
     assertEquals(content.getContentType(), Content.Type.TEXT);
-    content = factory.newContent(Content.Type.HTML, null);
+    content = factory.newContent(Content.Type.HTML);
     assertEquals(content.getContentType(), Content.Type.HTML);
-    content = factory.newContent(Content.Type.XHTML, null);
+    content = factory.newContent(Content.Type.XHTML);
     assertEquals(content.getContentType(), Content.Type.XHTML);
-    content = factory.newContent(Content.Type.MEDIA, null);
+    content = factory.newContent(Content.Type.MEDIA);
     assertEquals(content.getContentType(), Content.Type.MEDIA);
-    content = factory.newContent(Content.Type.XML, null);
+    content = factory.newContent(Content.Type.XML);
     assertEquals(content.getContentType(), Content.Type.XML);
-    content = factory.newContent(Content.Type.MEDIA, new MimeType("text/foo"), null);
+    content = factory.newContent(new MimeType("text/foo"));
     assertEquals(content.getContentType(), Content.Type.MEDIA);
     assertEquals(content.getMimeType().toString(), "text/foo");
-    Person contributor = factory.newContributor(null);
+    Person contributor = factory.newContributor();
     assertNotNull(contributor);
-    contributor = factory.newContributor("a", "b", "c", null);
+    contributor = factory.newContributor("a", "b", "c");
     assertNotNull(contributor);
     assertEquals(contributor.getName(),"a");
     assertEquals(contributor.getEmail(), "b");
     assertEquals(contributor.getUri().toString(), "c");
-    contributor = factory.newContributor("a", "b", new URI("c"), null);
+    contributor = factory.newContributor("a", "b", new URI("c"));
     assertNotNull(contributor);
     assertEquals(contributor.getName(),"a");
     assertEquals(contributor.getEmail(), "b");
     assertEquals(contributor.getUri().toString(), "c");
-    Control control = factory.newControl(null);
+    Control control = factory.newControl();
     assertNotNull(control);
-    control = factory.newControl(true, null);
+    control = factory.newControl(true);
     assertTrue(control.isDraft());
     Date now = new Date();
     DateTime dateTime = factory.newDateTime(Constants.UPDATED, AtomDate.valueOf(now), null);
@@ -355,69 +355,67 @@
     dateTime = factory.newDateTime(Constants.UPDATED, AtomDate.format(now), null);
     assertEquals(dateTime.getString(), AtomDate.format(now));
     assertEquals(dateTime.getDate(), now);
-    Generator generator = factory.newDefaultGenerator(null);
+    Generator generator = factory.newDefaultGenerator();
     assertNotNull(generator);
     assertEquals(generator.getValue(), Version.APP_NAME);
     assertEquals(generator.getVersion(), Version.VERSION);
     assertEquals(generator.getUri().toString(), Version.URI);
-    Div div = factory.newDiv(null);
+    Div div = factory.newDiv();
     assertNotNull(div);
     Document doc = factory.newDocument();
     assertNotNull(doc);
-    StringElement el = factory.newEmail(null);
+    StringElement el = factory.newEmail();
     assertNotNull(el);
-    el = factory.newEmail("a", null);
+    el = factory.newEmail("a");
     assertEquals(el.getValue(), "a");
     Entry entry = factory.newEntry();
     assertNotNull(entry);
-    entry = factory.newEntry(null);
+    entry = factory.newEntry();
     assertNotNull(entry);
-    ExtensionElement ee = factory.newExtensionElement(new QName("urn:foo", "bar", "b"), null);
+    ExtensionElement ee = factory.newExtensionElement(new QName("urn:foo", "bar", "b"));
     assertNotNull(ee);
     assertEquals(ee.getQName(), new QName("urn:foo", "bar", "b"));
     Feed feed = factory.newFeed();
     assertNotNull(feed);
-    feed = factory.newFeed(null);
-    assertNotNull(feed);
-    generator = factory.newGenerator(null);
+    generator = factory.newGenerator();
     assertNotNull(generator);
-    generator = factory.newGenerator(new URI(Version.URI), Version.VERSION, Version.APP_NAME, null);
+    generator = factory.newGenerator(new URI(Version.URI), Version.VERSION, Version.APP_NAME);
     assertNotNull(generator);
     assertEquals(generator.getValue(), Version.APP_NAME);
     assertEquals(generator.getVersion(), Version.VERSION);
     assertEquals(generator.getUri().toString(), Version.URI);
-    content = factory.newHtmlContent("a", null);
+    content = factory.newContent("a", Content.Type.HTML);
     assertNotNull(content);
     assertEquals(content.getValue(), "a");
     assertEquals(content.getContentType(), Content.Type.HTML);
-    Text text = factory.newHtmlRights("a", null);
+    Text text = factory.newRights("a",Text.Type.HTML);
     assertNotNull(text);
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.HTML);
-    text = factory.newHtmlSubtitle("a", null);
+    text = factory.newSubtitle("a",Text.Type.HTML);
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.HTML);
-    text = factory.newHtmlSummary("a", null);
+    text = factory.newSummary("a",Text.Type.HTML);
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.HTML);
-    text = factory.newHtmlText(Constants.TITLE, "a", null);
+    text = factory.newText(Constants.TITLE,"a", Text.Type.HTML, null);
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.HTML);
     assertEquals(text.getQName(), Constants.TITLE);
-    text = factory.newHtmlTitle("a", null);
+    text = factory.newTitle("a",Text.Type.HTML);
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.HTML);
-    IRI iri = factory.newIcon(null);
+    IRI iri = factory.newIcon();
     assertNotNull(iri);
-    iri = factory.newIcon("http://example.org/foo", null);
+    iri = factory.newIcon("http://example.org/foo");
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
-    iri = factory.newIcon(new URI("http://example.org/foo"), null);
+    iri = factory.newIcon(new URI("http://example.org/foo"));
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
-    iri = factory.newID(null);
+    iri = factory.newID();
     assertNotNull(iri);
-    iri = factory.newID("http://example.org/foo", null);
+    iri = factory.newID("http://example.org/foo");
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
-    iri = factory.newID(new URI("http://example.org/foo"), null);
+    iri = factory.newID(new URI("http://example.org/foo"));
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
     iri = factory.newIRIElement(Constants.ID, null);
     assertNotNull(iri);
@@ -425,55 +423,55 @@
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
     iri = factory.newIRIElement(Constants.ID, new URI("http://example.org/foo"), null);
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
-    InReplyTo inreplyto = factory.newInReplyTo(null);
+    InReplyTo inreplyto = factory.newInReplyTo();
     assertNotNull(inreplyto);
-    inreplyto = factory.newInReplyTo("http://example.org/foo", null);
+    inreplyto = factory.newInReplyTo("http://example.org/foo");
     assertNotNull(inreplyto);
     assertEquals(inreplyto.getRef().toString(), "http://example.org/foo");
-    inreplyto = factory.newInReplyTo(new URI("http://example.org/foo"), null);
+    inreplyto = factory.newInReplyTo(new URI("http://example.org/foo"));
     assertEquals(inreplyto.getRef().toString(), "http://example.org/foo");
-    inreplyto = factory.newInReplyTo("http://example.org/foo", "http://example.org/foo", "http://example.org/foo", "text/foo", null);
+    inreplyto = factory.newInReplyTo("http://example.org/foo", "http://example.org/foo", "http://example.org/foo", "text/foo");
     assertEquals(inreplyto.getRef().toString(), "http://example.org/foo");
     assertEquals(inreplyto.getSource().toString(), "http://example.org/foo");
     assertEquals(inreplyto.getHref().toString(), "http://example.org/foo");
     assertEquals(inreplyto.getMimeType().toString(), "text/foo");
-    inreplyto = factory.newInReplyTo(new URI("http://example.org/foo"), new URI("http://example.org/foo"), new URI("http://example.org/foo"), new MimeType("text/foo"), null);
+    inreplyto = factory.newInReplyTo(new URI("http://example.org/foo"), new URI("http://example.org/foo"), new URI("http://example.org/foo"), new MimeType("text/foo"));
     assertEquals(inreplyto.getRef().toString(), "http://example.org/foo");
     assertEquals(inreplyto.getSource().toString(), "http://example.org/foo");
     assertEquals(inreplyto.getHref().toString(), "http://example.org/foo");
     assertEquals(inreplyto.getMimeType().toString(), "text/foo");
-    Link link = factory.newLink(null);
+    Link link = factory.newLink();
     assertNotNull(link);
-    link = factory.newLink("http://example.org/foo", "a", new MimeType("text/foo"), "b", "en", 10, null);
+    link = factory.newLink("http://example.org/foo", "a", new MimeType("text/foo"), "b", "en", 10);
     assertEquals(link.getHref().toString(), "http://example.org/foo");
     assertEquals(link.getRel(), "a");
     assertEquals(link.getMimeType().toString(), "text/foo");
     assertEquals(link.getTitle(), "b");
     assertEquals(link.getHrefLang(), "en");
     assertEquals(link.getLength(), 10);
-    link = factory.newLink(new URI("http://example.org/foo"), "a", new MimeType("text/foo"), "b", "en", 10, null);
+    link = factory.newLink(new URI("http://example.org/foo"), "a", new MimeType("text/foo"), "b", "en", 10);
     assertEquals(link.getHref().toString(), "http://example.org/foo");
     assertEquals(link.getRel(), "a");
     assertEquals(link.getMimeType().toString(), "text/foo");
     assertEquals(link.getTitle(), "b");
     assertEquals(link.getHrefLang(), "en");
     assertEquals(link.getLength(), 10);
-    iri = factory.newLogo(null);
+    iri = factory.newLogo();
     assertNotNull(iri);
-    iri = factory.newLogo("http://example.org/foo", null);
+    iri = factory.newLogo("http://example.org/foo");
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
-    iri = factory.newLogo(new URI("http://example.org/foo"), null);
+    iri = factory.newLogo(new URI("http://example.org/foo"));
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
-    content = factory.newMediaContent(new MimeType("text/foo"), new URI("foo"), null, null);
+    content = factory.newContent(new URI("foo"), new MimeType("text/foo"));
     assertNotNull(content);
     assertEquals(content.getMimeType().toString(), "text/foo");
     assertEquals(content.getSrc().toString(), "foo");
-    content = factory.newMediaContent(new MimeType("text/foo"), null, new DataHandler(new ByteArrayDataSource("foo".getBytes())), null);
+    content = factory.newContent(new DataHandler(new ByteArrayDataSource("foo".getBytes())), new MimeType("text/foo"));
     assertEquals(content.getValue(), "Zm9v");
     assertEquals(content.getContentType(), Content.Type.MEDIA);
-    el = factory.newName(null);
+    el = factory.newName();
     assertNotNull(el);
-    el = factory.newName("a", null);
+    el = factory.newName("a");
     assertEquals(el.getValue(), "a");
     Parser parser = factory.newParser();
     assertNotNull(parser);
@@ -489,117 +487,115 @@
     assertEquals(person.getEmail(), "b");
     assertEquals(person.getUri().toString(), "c");
     now = new Date();
-    dateTime = factory.newPublished(AtomDate.valueOf(now), null);
+    dateTime = factory.newPublished(AtomDate.valueOf(now));
     assertEquals(dateTime.getDate(), now);
     cal = Calendar.getInstance();
-    dateTime = factory.newPublished(cal, null);
+    dateTime = factory.newPublished(cal);
     assertEquals(dateTime.getCalendar(), cal);
-    dateTime = factory.newPublished(now, null);
+    dateTime = factory.newPublished(now);
     assertEquals(dateTime.getDate(), now);
-    dateTime = factory.newPublished(null);
+    dateTime = factory.newPublished();
     assertNotNull(dateTime);
-    dateTime = factory.newPublished(now.getTime(), null);
+    dateTime = factory.newPublished(now.getTime());
     assertEquals(dateTime.getTime(), now.getTime());
-    dateTime = factory.newPublished(AtomDate.format(now), null);
+    dateTime = factory.newPublished(AtomDate.format(now));
     assertEquals(dateTime.getString(), AtomDate.format(now));
     assertEquals(dateTime.getDate(), now);
     Service service = factory.newService();
     assertNotNull(service);
-    service = factory.newService(null);
-    assertNotNull(service);
-    Source source = factory.newSource(null);
+    Source source = factory.newSource();
     assertNotNull(source);
-    el = factory.newStringElement(Constants.NAME, (Element)null);
+    el = factory.newStringElement(Constants.NAME);
     assertNotNull(el);
     assertEquals(el.getQName(), Constants.NAME);
-    el = factory.newStringElement(Constants.NAME, "a", (Element)null);
+    el = factory.newStringElement(Constants.NAME, "a");
     assertNotNull(el);
     assertEquals(el.getQName(), Constants.NAME);
     assertEquals(el.getValue(), "a");
-    text = factory.newText(Constants.TITLE, Text.Type.TEXT, null);
+    text = factory.newText(Constants.TITLE, Text.Type.TEXT);
     assertNotNull(text);
     assertEquals(text.getTextType(), Text.Type.TEXT);
-    text = factory.newTextRights("a", null);
+    text = factory.newRights("a");
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.TEXT);
-    text = factory.newTextSubtitle("a", null);
+    text = factory.newSubtitle("a");
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.TEXT);
-    text = factory.newTextSummary("a", null);
+    text = factory.newSummary("a");
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.TEXT);
-    text = factory.newTextText(Constants.TITLE, "a", null);
+    text = factory.newText(Constants.TITLE, "a", Text.Type.TEXT,null);
     assertEquals(text.getQName(), Constants.TITLE);
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.TEXT);
-    text = factory.newTextTitle("a", null);
+    text = factory.newTitle("a");
     assertEquals(text.getValue(), "a");
     assertEquals(text.getTextType(), Text.Type.TEXT);
-    content = factory.newTextContent("a", null);
+    content = factory.newContent("a",Content.Type.TEXT);
     assertEquals(content.getValue(), "a");
     assertEquals(content.getContentType(), Content.Type.TEXT);
-    Total total = factory.newTotal(null);
+    Total total = factory.newTotal();
     assertNotNull(total);
-    total = factory.newTotal(10, null);
+    total = factory.newTotal(10);
     assertEquals(total.getValue(), 10);
     now = new Date();
-    dateTime = factory.newUpdated(AtomDate.valueOf(now), null);
+    dateTime = factory.newUpdated(AtomDate.valueOf(now));
     assertEquals(dateTime.getDate(), now);
     cal = Calendar.getInstance();
-    dateTime = factory.newUpdated(cal, null);
+    dateTime = factory.newUpdated(cal);
     assertEquals(dateTime.getCalendar(), cal);
-    dateTime = factory.newUpdated(now, null);
+    dateTime = factory.newUpdated(now);
     assertEquals(dateTime.getDate(), now);
-    dateTime = factory.newUpdated(null);
+    dateTime = factory.newUpdated();
     assertNotNull(dateTime);
-    dateTime = factory.newUpdated(now.getTime(), null);
+    dateTime = factory.newUpdated(now.getTime());
     assertEquals(dateTime.getTime(), now.getTime());
-    dateTime = factory.newUpdated(AtomDate.format(now), null);
+    dateTime = factory.newUpdated(AtomDate.format(now));
     assertEquals(dateTime.getString(), AtomDate.format(now));
     assertEquals(dateTime.getDate(), now);
-    iri = factory.newUri(null);
+    iri = factory.newUri();
     assertNotNull(iri);
-    iri = factory.newUri("http://example.org/foo", null);
+    iri = factory.newUri("http://example.org/foo");
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
-    iri = factory.newUri(new URI("http://example.org/foo"), null);
+    iri = factory.newUri(new URI("http://example.org/foo"));
     assertEquals(iri.getValue().toString(), "http://example.org/foo");
-    Workspace workspace = factory.newWorkspace(null);
+    Workspace workspace = factory.newWorkspace();
     assertNotNull(workspace);
-    div = factory.newDiv(null);
-    content = factory.newXhtmlContent(div, null);
+    div = factory.newDiv();
+    content = factory.newContent(Content.Type.XHTML, div);
     assertNotNull(content);
     assertEquals(content.getContentType(), Content.Type.XHTML);
     assertNotNull(content.getValueElement());
     assertEquals(content.getValueElement(), div);
-    content = factory.newXmlContent(new MimeType("application/xml"), null, div, null);
+    content = factory.newContent(div, new MimeType("application/xml"));
     assertNotNull(content);
     assertEquals(content.getContentType(), Content.Type.XML);
     assertNotNull(content.getValueElement());
     assertEquals(content.getValueElement(), div);
-    text = factory.newXhtmlRights(div, null);
+    text = factory.newRights(div);
     assertNotNull(text);
     assertEquals(text.getTextType(), Text.Type.XHTML);
     assertEquals(text.getValueElement(), div);
-    text = factory.newXhtmlSubtitle(div, null);
+    text = factory.newSubtitle(div);
     assertNotNull(text);
     assertEquals(text.getTextType(), Text.Type.XHTML);
     assertEquals(text.getValueElement(), div);
-    text = factory.newXhtmlSummary(div, null);
+    text = factory.newSummary(div);
     assertNotNull(text);
     assertEquals(text.getTextType(), Text.Type.XHTML);
     assertEquals(text.getValueElement(), div);
-    text = factory.newXhtmlText(Constants.TITLE, div, null);
+    text = factory.newText(Constants.TITLE, div, null);
     assertNotNull(text);
     assertEquals(text.getQName(), Constants.TITLE);
     assertEquals(text.getTextType(), Text.Type.XHTML);
     assertEquals(text.getValueElement(), div);
-    text = factory.newXhtmlTitle(div, null);
+    text = factory.newTitle(div);
     assertNotNull(text);
     assertEquals(text.getTextType(), Text.Type.XHTML);
     assertEquals(text.getValueElement(), div);
     QName qname = new QName("urn:foo", "bar");
     factory.registerAsSimpleExtension(qname);
-    el = (StringElement) factory.newExtensionElement(qname, null);
+    el = (StringElement) factory.newExtensionElement(qname);
     assertEquals(el.getQName(), qname);
   }
   
@@ -609,7 +605,7 @@
     feed.setLanguage("en-US");
     feed.setBaseUri("http://example.org");
     
-    feed.setTitleAsText("Example Feed");
+    feed.setTitle("Example Feed");
     feed.addLink("http://example.org/");
     feed.addAuthor("John Doe");
     feed.setId("urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", false);
@@ -617,16 +613,16 @@
     feed.addCategory("example");
     
     Entry entry = feed.insertEntry();
-    entry.setTitleAsText("Atom-Powered Robots Run Amok");
+    entry.setTitle("Atom-Powered Robots Run Amok");
     entry.addLink("http://example.org/2003/12/13/atom03");
     entry.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", false);
-    entry.setSummaryAsText("Some text.");
+    entry.setSummary("Some text.");
     
     Entry entry2 = feed.insertEntry();
-    entry2.setTitleAsText("re: Atom-Powered Robots Run Amok");
+    entry2.setTitle("re: Atom-Powered Robots Run Amok");
     entry2.addLink("/2003/12/13/atom03/1");
     entry2.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b", false);
-    entry2.setSummaryAsText("A response");
+    entry2.setSummary("A response");
     entry2.addInReplyTo(entry);
     
     ByteArrayOutputStream out = new ByteArrayOutputStream();

Modified: incubator/abdera/site/trunk/docs/gettingstarted.html
URL: http://svn.apache.org/viewvc/incubator/abdera/site/trunk/docs/gettingstarted.html?rev=416512&r1=416511&r2=416512&view=diff
==============================================================================
--- incubator/abdera/site/trunk/docs/gettingstarted.html (original)
+++ incubator/abdera/site/trunk/docs/gettingstarted.html Thu Jun 22 16:34:07 2006
@@ -108,7 +108,7 @@
     
     <pre>Feed feed = Factory.INSTANCE.newFeed();
 feed.setId("tag:example.org,2005:/myfeed", false);
-feed.setTitleAsText("My Example Feed");
+feed.setTitle("My Example Feed");
 // .. set other feed properties
 Document&lt;Feed&gt; doc = feed.getDocument();
 doc.writeTo(System.out); // serializes the feed document to System.out
@@ -118,7 +118,7 @@
 
     <pre>Entry entry = Factory.INSTANCE.newEntry();
 entry.setId("tag:example.org,2005:/myentry", false);
-entry.setTitleAsText("My Example Entry");
+entry.setTitle("My Example Entry");
 // .. set other feed properties
 Document&lt;Entry&gt; doc = entry.getDocument();
 doc.writeTo(System.out); // serializes the entry document to System.out



Mime
View raw message