abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r451450 [2/4] - in /incubator/abdera/java/trunk: client/src/test/java/org/apache/abdera/test/client/app/ core/src/main/java/org/apache/abdera/model/ core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/util/ cor...
Date Fri, 29 Sep 2006 21:22:54 GMT
Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java Fri Sep 29 14:22:50 2006
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -27,6 +25,8 @@
 import org.apache.abdera.model.Categories;
 import org.apache.abdera.model.Category;
 import org.apache.abdera.parser.stax.util.FOMHelper;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -106,7 +106,7 @@
     String scheme, 
     String term, 
     String label)
-      throws URISyntaxException {
+      throws IRISyntaxException {
     FOMFactory factory = (FOMFactory) this.factory;
     Category category = factory.newCategory(this);
     category.setTerm(term);
@@ -120,15 +120,15 @@
     return _getChildrenAsSet(CATEGORY);
   }
 
-  public List<Category> getCategories(String scheme) throws URISyntaxException {
+  public List<Category> getCategories(String scheme) throws IRISyntaxException {
     return FOMHelper.getCategories(this, scheme);
   }
   
   private List<Category> copyCategoriesWithScheme(
     List<Category> cats) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     List<Category> newcats = new ArrayList<Category>();
-    URI scheme = getScheme();
+    IRI scheme = getScheme();
     for (Category cat : cats) {
       Category newcat = (Category) cat.clone();
       if (newcat.getScheme() == null && scheme != null) 
@@ -138,17 +138,17 @@
     return newcats;
   }
   
-  public List<Category> getCategoriesWithScheme() throws URISyntaxException {
+  public List<Category> getCategoriesWithScheme() throws IRISyntaxException {
     return copyCategoriesWithScheme(getCategories());
   }
   
-  public List<Category> getCategoriesWithScheme(String scheme) throws URISyntaxException {
+  public List<Category> getCategoriesWithScheme(String scheme) throws IRISyntaxException {
     return copyCategoriesWithScheme(getCategories(scheme));
   }
 
-  public java.net.URI getScheme() throws URISyntaxException {
+  public IRI getScheme() throws IRISyntaxException {
     String value = getAttributeValue(SCHEME);
-    return (value != null) ? new URI(value) : null;
+    return (value != null) ? new IRI(value) : null;
   }
 
   public boolean isFixed() {
@@ -163,45 +163,45 @@
       removeAttribute(FIXED);
   }
 
-  public void setScheme(String scheme) throws URISyntaxException {
+  public void setScheme(String scheme) throws IRISyntaxException {
     if (scheme != null)
-      setAttributeValue(SCHEME, new URI(scheme).toString());
+      setAttributeValue(SCHEME, new IRI(scheme).toString());
     else 
       removeAttribute(SCHEME);
   }
   
-  public URI getHref() throws URISyntaxException {
+  public IRI getHref() throws IRISyntaxException {
     return _getUriValue(getAttributeValue(HREF));
   }
 
-  public URI getResolvedHref() throws URISyntaxException {
+  public IRI getResolvedHref() throws IRISyntaxException {
     return _resolve(getResolvedBaseUri(), getHref());
   }
   
-  public void setHref(String href) throws URISyntaxException {
+  public void setHref(String href) throws IRISyntaxException {
     if (href != null)
-      setAttributeValue(HREF, (new URI(href)).toString());
+      setAttributeValue(HREF, (new IRI(href)).toString());
     else 
       removeAttribute(HREF);
   }
 
   public boolean contains(
     String term) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     return contains(term,null);
   }
 
   public boolean contains(
     String term, 
     String scheme) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     List<Category> categories = getCategories();
-    URI catscheme = getScheme();
-    URI uri = (scheme != null) ? 
-      new URI(scheme) : catscheme;
+    IRI catscheme = getScheme();
+    IRI uri = (scheme != null) ? 
+      new IRI(scheme) : catscheme;
     for (Category category : categories) {
       String t = category.getTerm();
-      URI s = (category.getScheme() != null) ? 
+      IRI s = (category.getScheme() != null) ? 
         category.getScheme() : catscheme;
       if (t.equals(term) && 
           ((uri!=null)? uri.equals(s) : s == null))

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java Fri Sep 29 14:22:50 2006
@@ -17,13 +17,12 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.model.Category;
 import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -50,7 +49,7 @@
     String term, 
     String scheme, 
     String label) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     this();
     setTerm(term);
     setScheme(scheme);
@@ -105,14 +104,14 @@
       removeAttribute(TERM);
   }
 
-  public URI getScheme() throws URISyntaxException {
+  public IRI getScheme() throws IRISyntaxException {
     String value = getAttributeValue(SCHEME);
-    return (value != null) ? new URI(value) : null;
+    return (value != null) ? new IRI(value) : null;
   }
 
-  public void setScheme(String scheme) throws URISyntaxException {
+  public void setScheme(String scheme) throws IRISyntaxException {
     if (scheme != null)
-      setAttributeValue(SCHEME, new URI(scheme).toString());
+      setAttributeValue(SCHEME, new IRI(scheme).toString());
     else 
       removeAttribute(SCHEME);
   }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java Fri Sep 29 14:22:50 2006
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.List;
 
 import javax.activation.MimeType;
@@ -31,6 +29,8 @@
 import org.apache.abdera.model.Text;
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.MimeTypeHelper;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -52,7 +52,7 @@
     String title, 
     String href, 
     String[] accepts) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     this();
     setTitle(title);
     setHref(href);
@@ -125,17 +125,17 @@
     return getFirstChild(TITLE);
   }
   
-  public URI getHref() throws URISyntaxException {
+  public IRI getHref() throws IRISyntaxException {
     return _getUriValue(getAttributeValue(HREF));
   }
 
-  public URI getResolvedHref() throws URISyntaxException {
+  public IRI getResolvedHref() throws IRISyntaxException {
     return _resolve(getResolvedBaseUri(), getHref());
   }
   
-  public void setHref(String href) throws URISyntaxException {
+  public void setHref(String href) throws IRISyntaxException {
     if (href != null)
-      setAttributeValue(HREF, (new URI(href).toString()));
+      setAttributeValue(HREF, (new IRI(href).toString()));
     else 
       removeAttribute(HREF);
   }
@@ -191,7 +191,7 @@
 
   public Categories addCategories(
     String href) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     Categories cats = ((FOMFactory)factory).newCategories();
     cats.setHref(href);
     addCategories(cats);
@@ -202,7 +202,7 @@
     List<Category> categories, 
     boolean fixed, 
     String scheme) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
       Categories cats = ((FOMFactory)factory).newCategories();
       cats.setFixed(fixed);
       if (scheme != null) cats.setScheme(scheme);

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,9 +17,6 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.activation.DataHandler;
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
@@ -30,6 +27,8 @@
 import org.apache.abdera.model.Div;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.attachments.DataHandlerUtils;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
@@ -160,17 +159,17 @@
       removeAttribute(TYPE);
   }
 
-  public URI getSrc() throws URISyntaxException {
+  public IRI getSrc() throws IRISyntaxException {
     return _getUriValue(getAttributeValue(SRC));
   }
 
-  public URI getResolvedSrc() throws URISyntaxException {
+  public IRI getResolvedSrc() throws IRISyntaxException {
     return _resolve(getResolvedBaseUri(), getSrc());
   }
   
-  public void setSrc(String src) throws URISyntaxException {
+  public void setSrc(String src) throws IRISyntaxException {
     if (src != null)
-      setAttributeValue(SRC, (new URI(src)).toString());
+      setAttributeValue(SRC, (new IRI(src)).toString());
     else 
       removeAttribute(SRC);
 
@@ -239,20 +238,22 @@
         _removeAllChildren();
         super.setText(value);
       } else if (Type.XHTML.equals(type)) {
-        URI baseUri = null;
+        IRI baseUri = null;
+        Element element = null;
+        value = "<div xmlns=\"" + XHTML_NS + "\">" + value + "</div>";
         try {
           baseUri = getResolvedBaseUri();
+          element = _parse(value, baseUri);
         } catch (Exception e) {}
-        value = "<div xmlns=\"" + XHTML_NS + "\">" + value + "</div>";
-        Element element = _parse(value, baseUri);
         if (element != null && element instanceof Div)
           setValueElement((Div)element);
       } else if (Type.XML.equals(type)) {
-        URI baseUri = null;
+        IRI baseUri = null;
+        Element element = null;
         try {
           baseUri = getResolvedBaseUri();
+          element = _parse(value, baseUri);
         } catch (Exception e) {}
-        Element element = _parse(value, baseUri);
         if (element != null)
           setValueElement(element);
         try {
@@ -282,11 +283,12 @@
 
   public void setWrappedValue(String wrappedValue) {
     if (Type.XHTML.equals(type)) {
-      URI baseUri = null;
+      IRI baseUri = null;
+      Element element = null;
       try {
         baseUri = getResolvedBaseUri();
+        element = _parse(wrappedValue, baseUri);
       } catch (Exception e) {}
-      Element element = _parse(wrappedValue, baseUri);
       if (element != null && element instanceof Div)
         setValueElement((Div)element);
     } else {
@@ -295,8 +297,8 @@
   }
 
   @Override
-  public URI getBaseUri()
-    throws URISyntaxException {
+  public IRI getBaseUri()
+    throws IRISyntaxException {
       if (Type.XHTML.equals(type)) {
         Element el = getValueElement();
         if (el != null) {
@@ -313,8 +315,8 @@
   }
 
   @Override
-  public URI getResolvedBaseUri()
-    throws URISyntaxException {
+  public IRI getResolvedBaseUri()
+    throws IRISyntaxException {
       if (Type.XHTML.equals(type)) {
         Element el = getValueElement();
         if (el != null) {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDiv.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDiv.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDiv.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDiv.java Fri Sep 29 14:22:50 2006
@@ -18,7 +18,6 @@
 package org.apache.abdera.parser.stax;
 
 import java.io.ByteArrayOutputStream;
-import java.net.URI;
 import java.util.Iterator;
 
 import javax.xml.namespace.QName;
@@ -27,6 +26,7 @@
 
 import org.apache.abdera.model.Div;
 import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.iri.IRI;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -121,12 +121,13 @@
   public void setValue(String value) {
     _removeAllChildren();
     if (value != null) {
-      URI baseUri = null;
+      IRI baseUri = null;
+      value = "<div xmlns=\"" + XHTML_NS + "\">" + value + "</div>";
+      OMElement element = null;
       try {
         baseUri = getResolvedBaseUri();
+        element = (OMElement) _parse(value, baseUri);
       } catch (Exception e) {}
-      value = "<div xmlns=\"" + XHTML_NS + "\">" + value + "</div>";
-      OMElement element = (OMElement) _parse(value, baseUri);
       for (Iterator i = element.getChildren(); i.hasNext();) {
         this.addChild((OMNode)i.next());
       }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java Fri Sep 29 14:22:50 2006
@@ -20,8 +20,6 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Date;
 import java.util.Iterator;
 
@@ -32,6 +30,8 @@
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMComment;
 import org.apache.axiom.om.OMDocType;
 import org.apache.axiom.om.OMDocument;
@@ -51,7 +51,7 @@
   implements Document<T> {
 
   private static final long serialVersionUID = -3255339511063344662L;
-  protected URI base = null;
+  protected IRI base = null;
   protected MimeType contentType = null;
   protected Date lastModified = null;
 
@@ -97,12 +97,12 @@
     this.setOMDocumentElement((OMElement) root);
   }
 
-  public URI getBaseUri() {
+  public IRI getBaseUri() {
     return base;
   }
 
-  public void setBaseUri(String base) throws URISyntaxException {
-    this.base = new URI(base);
+  public void setBaseUri(String base) throws IRISyntaxException {
+    this.base = new IRI(base);
   }
 
   public void writeTo(OutputStream out) throws IOException {

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java Fri Sep 29 14:22:50 2006
@@ -21,8 +21,6 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -43,12 +41,15 @@
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.Link;
 import org.apache.abdera.model.Text;
+import org.apache.abdera.parser.ParseException;
 import org.apache.abdera.parser.Parser;
 import org.apache.abdera.parser.ParserOptions;
 import org.apache.abdera.parser.stax.util.FOMList;
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.abdera.util.URIHelper;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMComment;
 import org.apache.axiom.om.OMContainer;
@@ -188,8 +189,8 @@
     setAttributeValue(LANG,language);
   }
 
-  public URI getBaseUri() throws URISyntaxException {
-    URI uri = _getUriValue(getAttributeValue(BASE));
+  public IRI getBaseUri() throws IRISyntaxException {
+    IRI uri = _getUriValue(getAttributeValue(BASE));
     if (URIHelper.isJavascriptUri(uri) || 
         URIHelper.isMailtoUri(uri)) { uri = null; }
     if (uri == null) {
@@ -202,9 +203,9 @@
     return uri;
   }
 
-  public URI getResolvedBaseUri() throws URISyntaxException {
-    URI baseUri = null;
-    URI uri = _getUriValue(getAttributeValue(BASE));
+  public IRI getResolvedBaseUri() throws IRISyntaxException {
+    IRI baseUri = null;
+    IRI uri = _getUriValue(getAttributeValue(BASE));
     if (URIHelper.isJavascriptUri(uri) || 
         URIHelper.isMailtoUri(uri)) { uri = null; }
     if (parent instanceof Element) 
@@ -219,12 +220,12 @@
     return uri;    
   }
   
-  public void setBaseUri(URI base) {
+  public void setBaseUri(IRI base) {
     setAttributeValue(BASE,_getStringValue(base));
   }
   
-  public void setBaseUri(String base) throws URISyntaxException {
-    setBaseUri((base != null) ? new URI(base) : null);
+  public void setBaseUri(String base) throws IRISyntaxException {
+    setBaseUri((base != null) ? new IRI(base) : null);
   }
   
   public String getAttributeValue(QName qname) {
@@ -275,15 +276,15 @@
     }
   }
   
-  protected URI _getUriValue(String v) throws URISyntaxException {
-    return (v != null) ? new URI(v) : null;
+  protected IRI _getUriValue(String v) throws IRISyntaxException {
+    return (v != null) ? new IRI(v) : null;
   }
   
-  protected String _getStringValue(URI uri) {
+  protected String _getStringValue(IRI uri) {
     return (uri != null) ? uri.toString() : null;
   }
   
-  protected URI _resolve(URI base, URI value) {
+  protected IRI _resolve(IRI base, IRI value) throws IRISyntaxException {
     if (value == null) return null;
     if ("".equals(value.toString()) || 
         "#".equals(value.toString()) ||
@@ -291,7 +292,7 @@
         "./".equals(value.toString())) return base;
     if (base == null) return value;
     if ("".equals(base.getPath())) base = base.resolve("/");
-    URI resolved = (base != null) ? base.resolve(value) : value;
+    IRI resolved = (base != null) ? base.resolve(value) : value;
     return resolved;
   }
 
@@ -382,7 +383,7 @@
     return text;
   }
 
-  protected Text setHtmlText(QName qname, String value, URI baseUri) {
+  protected Text setHtmlText(QName qname, String value, IRI baseUri) {
     if (value == null) {
       setTextElement(qname, null, false);
       return null;
@@ -395,7 +396,7 @@
     return text;
   }
   
-  protected Text setXhtmlText(QName qname, String value, URI baseUri) {
+  protected Text setXhtmlText(QName qname, String value, IRI baseUri) {
     if (value == null) {
       setTextElement(qname, null, false);
       return null;
@@ -408,7 +409,7 @@
     return text;
   }
 
-  protected Text setXhtmlText(QName qname, Div value, URI baseUri) {
+  protected Text setXhtmlText(QName qname, Div value, IRI baseUri) {
     if (value == null) {
       setTextElement(qname, null, false);
       return null;
@@ -450,7 +451,7 @@
   }
   
   
-  protected Element _parse(String value, URI baseUri) {
+  protected Element _parse(String value, IRI baseUri) throws ParseException, IRISyntaxException {
     if (value == null) return null;
     FOMFactory fomfactory = (FOMFactory) factory;
     Parser parser = fomfactory.newParser();
@@ -458,7 +459,7 @@
     ParserOptions options = parser.getDefaultParserOptions();
     options.setCharset(getXMLStreamReader().getCharacterEncodingScheme());
     options.setFactory(fomfactory);
-    Document doc = parser.parse(bais, baseUri, options);
+    Document doc = parser.parse(bais, baseUri.toString(), options);
     return doc.getRoot();
   }
 

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Date;
 import java.util.List;
 
@@ -46,6 +44,8 @@
 import org.apache.abdera.parser.stax.util.FOMHelper;
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.URIHelper;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -121,7 +121,7 @@
     return person;
   }
 
-  public Person addAuthor(String name, String email, String uri) throws URISyntaxException {
+  public Person addAuthor(String name, String email, String uri) throws IRISyntaxException {
     FOMFactory fomfactory = (FOMFactory) this.factory;
     Person person = fomfactory.newAuthor(this);
     person.setName(name);
@@ -134,7 +134,7 @@
     return _getChildrenAsSet(CATEGORY);
   }
 
-  public List<Category> getCategories(String scheme) throws URISyntaxException {
+  public List<Category> getCategories(String scheme) throws IRISyntaxException {
     return FOMHelper.getCategories(this, scheme);
   }
 
@@ -160,7 +160,7 @@
     return category;
   }
 
-  public Category addCategory(String scheme, String term, String label) throws URISyntaxException {
+  public Category addCategory(String scheme, String term, String label) throws IRISyntaxException {
     FOMFactory factory = (FOMFactory) this.factory;
     Category category = factory.newCategory(this);
     category.setTerm(term);
@@ -271,9 +271,9 @@
   /**
    * Sets the content for this entry
    * @throws MimeTypeParseException 
- * @throws URISyntaxException 
+ * @throws IRISyntaxException 
    */
-  public Content setContent(URI uri, String mediatype) throws MimeTypeParseException, URISyntaxException {
+  public Content setContent(IRI uri, String mediatype) throws MimeTypeParseException, IRISyntaxException {
     FOMFactory factory = (FOMFactory) this.factory;
     Content content = factory.newContent(new MimeType(mediatype));
     content.setSrc(uri.toString());
@@ -301,7 +301,7 @@
     String name, 
     String email, 
     String uri) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     FOMFactory fomfactory = (FOMFactory) this.factory;
     Person person = fomfactory.newContributor(this);
     person.setName(name);
@@ -321,16 +321,16 @@
       _removeChildren(ID, false);
   }
 
-  public URI getId() throws URISyntaxException {
+  public IRI getId() throws IRISyntaxException {
     IRIElement id = getIdElement();
     return (id != null) ? id.getValue() : null;
   }
   
-  public IRIElement setId(String value) throws URISyntaxException {
+  public IRIElement setId(String value) throws IRISyntaxException {
     return setId(value, false);
   }
   
-  public IRIElement setId(String value, boolean normalize) throws URISyntaxException {
+  public IRIElement setId(String value, boolean normalize) throws IRISyntaxException {
     if (value == null) {
       _removeChildren(ID, false);
       return null;
@@ -360,11 +360,11 @@
     addChild((OMElement)link);
   }
 
-  public Link addLink(String href) throws URISyntaxException {
+  public Link addLink(String href) throws IRISyntaxException {
     return addLink(href, null);
   }
   
-  public Link addLink(String href, String rel) throws URISyntaxException {
+  public Link addLink(String href, String rel) throws IRISyntaxException {
     FOMFactory fomfactory = (FOMFactory) factory;
     Link link = fomfactory.newLink(this);
     link.setHref(href);
@@ -379,7 +379,7 @@
     String title, 
     String hreflang, 
     long length) 
-      throws URISyntaxException, MimeTypeParseException {
+      throws IRISyntaxException, MimeTypeParseException {
     FOMFactory fomfactory = (FOMFactory) factory;
     Link link = fomfactory.newLink(this);
     link.setHref(href);
@@ -700,27 +700,27 @@
     return getLink(Link.REL_EDIT_MEDIA);
   }
   
-  public URI getLinkResolvedHref(String rel) throws URISyntaxException {
+  public IRI getLinkResolvedHref(String rel) throws IRISyntaxException {
     Link link = getLink(rel);
     return (link != null) ? link.getResolvedHref() : null;
   }
-  public URI getAlternateLinkResolvedHref() throws URISyntaxException {
+  public IRI getAlternateLinkResolvedHref() throws IRISyntaxException {
     Link link = getAlternateLink();
     return (link != null) ? link.getResolvedHref() : null;
   }
-  public URI getEnclosureLinkResolvedHref() throws URISyntaxException {
+  public IRI getEnclosureLinkResolvedHref() throws IRISyntaxException {
     Link link = getEnclosureLink();
     return (link != null) ? link.getResolvedHref() : null;
   }
-  public URI getEditLinkResolvedHref() throws URISyntaxException {
+  public IRI getEditLinkResolvedHref() throws IRISyntaxException {
     Link link = getEditLink();
     return (link != null) ? link.getResolvedHref() : null;
   }
-  public URI getEditMediaLinkResolvedHref() throws URISyntaxException {
+  public IRI getEditMediaLinkResolvedHref() throws IRISyntaxException {
     Link link = getEditMediaLink();
     return (link != null) ? link.getResolvedHref() : null;
   }
-  public URI getSelfLinkResolvedHref() throws URISyntaxException {
+  public IRI getSelfLinkResolvedHref() throws IRISyntaxException {
     Link link = getSelfLink();
     return (link != null) ? link.getResolvedHref() : null;
   }
@@ -730,7 +730,7 @@
     return (content != null) ? content.getValue() : null;
   }
   
-  public URI getContentSrc() throws URISyntaxException {
+  public IRI getContentSrc() throws IRISyntaxException {
     Content content = getContentElement();
     return (content != null) ? content.getResolvedSrc() : null;
   }
@@ -767,10 +767,10 @@
     return selectLink(getLinks(Link.REL_ALTERNATE), type, hreflang);
   }
 
-  public java.net.URI getAlternateLinkResolvedHref(
+  public IRI getAlternateLinkResolvedHref(
     String type, 
     String hreflang) 
-      throws URISyntaxException, 
+      throws IRISyntaxException, 
              MimeTypeParseException {
     Link link = getAlternateLink(type, hreflang);
     return (link != null) ? link.getResolvedHref() : null;
@@ -783,10 +783,10 @@
     return selectLink(getLinks(Link.REL_EDIT_MEDIA), type, hreflang);
   }
 
-  public java.net.URI getEditMediaLinkResolvedHref(
+  public IRI getEditMediaLinkResolvedHref(
     String type, 
     String hreflang) 
-      throws URISyntaxException, 
+      throws IRISyntaxException, 
              MimeTypeParseException {
     Link link = getEditMediaLink(type, hreflang);
     return (link != null) ? link.getResolvedHref() : null;

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -22,7 +22,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.net.URISyntaxException;
 
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
@@ -58,6 +57,7 @@
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.MimeTypeHelper;
 import org.apache.abdera.util.Version;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
@@ -287,7 +287,7 @@
       generator.setText(Version.APP_NAME);
       try {
         generator.setUri(Version.URI);
-      } catch (URISyntaxException e) { /* Can't happen */ }
+      } catch (IRISyntaxException e) { /* Can't happen */ }
       return generator;
   }
   

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.Date;
@@ -31,6 +29,8 @@
 import org.apache.abdera.model.Feed;
 import org.apache.abdera.model.Source;
 import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -172,12 +172,12 @@
     }
   };
 
-  public Entry getEntry(String id) throws URISyntaxException {
+  public Entry getEntry(String id) throws IRISyntaxException {
     if (id == null) return null;
     List<Entry> l = getEntries();
     for (Entry e : l) {
-      URI eid = e.getId();
-      if (eid != null && eid.equals(new URI(id))) return e;
+      IRI eid = e.getId();
+      if (eid != null && eid.equals(new IRI(id))) return e;
     }
     return null;
   }

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,13 +17,12 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.model.Generator;
 import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -44,7 +43,7 @@
     String value, 
     String version, 
     String uri) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     this();
     setText(value);
     setVersion(version);
@@ -90,18 +89,18 @@
     super(GENERATOR, parent, factory, builder);
   }
   
-  public URI getUri() throws URISyntaxException {
+  public IRI getUri() throws IRISyntaxException {
     String value = getAttributeValue(AURI);
-    return (value != null) ? new URI(value) : null;
+    return (value != null) ? new IRI(value) : null;
 }
 
-  public URI getResolvedUri() throws URISyntaxException {
+  public IRI getResolvedUri() throws IRISyntaxException {
     return _resolve(getResolvedBaseUri(), getUri());
   }
 
-  public void setUri(String uri) throws URISyntaxException {
+  public void setUri(String uri) throws IRISyntaxException {
     if (uri != null)
-      setAttributeValue(AURI, (new URI(uri)).toString());
+      setAttributeValue(AURI, (new IRI(uri)).toString());
     else 
       removeAttribute(AURI);
   }

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,13 +17,12 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.model.IRIElement;
 import org.apache.abdera.util.URIHelper;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -40,7 +39,7 @@
     super(qname);
   }
   
-  public FOMIRI(QName qname, String value) throws URISyntaxException {
+  public FOMIRI(QName qname, String value) throws IRISyntaxException {
     this(qname);
     setValue(value);
   }
@@ -71,23 +70,23 @@
     super(qname, parent, factory, builder);
   }
   
-  public URI getValue() throws URISyntaxException {
+  public IRI getValue() throws IRISyntaxException {
     return _getUriValue(getText());
   }
 
-  public void setValue(String iri) throws URISyntaxException {
+  public void setValue(String iri) throws IRISyntaxException {
     if (iri != null)
-      setText((new URI(iri)).toString());
+      setText((new IRI(iri)).toString());
     else
       _removeAllChildren();
 
   }
   
-  public java.net.URI getResolvedValue() throws URISyntaxException {
+  public IRI getResolvedValue() throws IRISyntaxException {
     return _resolve(getResolvedBaseUri(), getValue());
   }
 
-  public void setNormalizedValue(String uri) throws URISyntaxException {
+  public void setNormalizedValue(String uri) throws IRISyntaxException {
     if (uri != null)
       setValue(URIHelper.normalize(uri));
     else 

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -29,6 +27,8 @@
 import org.apache.abdera.model.Link;
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.URIHelper;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -47,7 +47,7 @@
   
   public FOMLink(
     String href) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     this();
     setHref(href);
   }
@@ -55,7 +55,7 @@
   public FOMLink(
     String href, 
     String rel) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     this();
     setHref(href);
     setRel(rel);
@@ -102,17 +102,17 @@
     super(qname, parent, factory, builder);
   }
   
-  public URI getHref() throws URISyntaxException {
+  public IRI getHref() throws IRISyntaxException {
     return _getUriValue(getAttributeValue(HREF));
   }
 
-  public URI getResolvedHref() throws URISyntaxException {
+  public IRI getResolvedHref() throws IRISyntaxException {
     return _resolve(getResolvedBaseUri(), getHref());
   }
   
-  public void setHref(String href) throws URISyntaxException {
+  public void setHref(String href) throws IRISyntaxException {
     if (href != null)
-      setAttributeValue(HREF, (new URI(href)).toString());
+      setAttributeValue(HREF, (new IRI(href)).toString());
     else 
       removeAttribute(HREF);
   }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java Fri Sep 29 14:22:50 2006
@@ -19,7 +19,6 @@
 
 import java.io.InputStream;
 import java.io.Reader;
-import java.net.URI;
 
 import javax.xml.stream.XMLStreamReader;
 
@@ -32,6 +31,7 @@
 import org.apache.abdera.parser.ParserOptions;
 import org.apache.abdera.parser.stax.util.FOMSniffingInputStream;
 import org.apache.abdera.util.AbstractParser;
+import org.apache.abdera.util.iri.IRI;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.util.StAXUtils;
 
@@ -68,7 +68,7 @@
   
   private <T extends Element>Document<T> getDocument(
     FOMBuilder builder, 
-    URI base) {
+    IRI base) {
       Document<T> document = builder.getFomDocument();
       try {
         document.setBaseUri(base.toString());
@@ -85,7 +85,7 @@
   
   public <T extends Element>Document<T> parse(
     InputStream in, 
-    URI base, 
+    String base, 
     ParserOptions options)
       throws ParseException {
     Document<T> document = null;
@@ -106,7 +106,7 @@
       if (options != null && charset != null) options.setCharset(charset);
       FOMFactory factory = getFomFactory(options);
       FOMBuilder builder = new FOMBuilder(factory, xmlreader, options);
-      document = getDocument(builder, base);
+      document = getDocument(builder, (base != null) ? new IRI(base) : null);
       setCharset(options, xmlreader.getCharacterEncodingScheme(), document);
     } catch (Exception e) {
       if (!(e instanceof ParseException))
@@ -118,7 +118,7 @@
 
   public <T extends Element> Document<T> parse(
     Reader in, 
-    URI base, 
+    String base, 
     ParserOptions options) 
       throws ParseException {
     Document<T> document = null;
@@ -128,7 +128,7 @@
       FOMFactory factory = getFomFactory(options);
       XMLStreamReader xmlreader = StAXUtils.createXMLStreamReader(in);
       FOMBuilder builder = new FOMBuilder(factory, xmlreader, options);
-      document = getDocument(builder, base);
+      document = getDocument(builder, new IRI(base));
       setCharset(options, xmlreader.getCharacterEncodingScheme(), document);
     } catch (Exception e) {
       if (!(e instanceof ParseException))

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,14 +17,13 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.IRIElement;
 import org.apache.abdera.model.Person;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -54,7 +53,7 @@
     String name, 
     String email, 
     String uri) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     this(qname);
     setName(name);
     setEmail(email);
@@ -158,7 +157,7 @@
       _removeChildren(URI, false);
   }
 
-  public IRIElement setUri(String uri) throws URISyntaxException {
+  public IRIElement setUri(String uri) throws IRISyntaxException {
     if (uri != null) {
       FOMFactory fomfactory = (FOMFactory) factory;
       IRIElement el = fomfactory.newUri(null);
@@ -171,7 +170,7 @@
     }
   }
   
-  public URI getUri() throws URISyntaxException {
+  public IRI getUri() throws IRISyntaxException {
     IRIElement iri = getUriElement();
     return (iri != null) ? iri.getValue() : null;
   }

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Date;
 import java.util.List;
 
@@ -41,6 +39,8 @@
 import org.apache.abdera.parser.stax.util.FOMHelper;
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.URIHelper;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -118,7 +118,7 @@
     return person;
   }
 
-  public Person addAuthor(String name, String email, String uri) throws URISyntaxException {
+  public Person addAuthor(String name, String email, String uri) throws IRISyntaxException {
     FOMFactory fomfactory = (FOMFactory) this.factory;
     Person person = fomfactory.newAuthor(this);
     person.setName(name);
@@ -131,7 +131,7 @@
     return _getChildrenAsSet(CATEGORY);
   }
 
-  public List<Category> getCategories(String scheme) throws URISyntaxException {
+  public List<Category> getCategories(String scheme) throws IRISyntaxException {
     return FOMHelper.getCategories(this, scheme);
   }
   
@@ -157,7 +157,7 @@
     return category;
   }
 
-  public Category addCategory(String scheme, String term, String label) throws URISyntaxException {
+  public Category addCategory(String scheme, String term, String label) throws IRISyntaxException {
     FOMFactory factory = (FOMFactory) this.factory;
     Category category = factory.newCategory(this);
     category.setTerm(term);
@@ -181,7 +181,7 @@
     return person;
   }
 
-  public Person addContributor(String name, String email, String uri) throws URISyntaxException {
+  public Person addContributor(String name, String email, String uri) throws IRISyntaxException {
     FOMFactory fomfactory = (FOMFactory) this.factory;
     Person person = fomfactory.newContributor(this);
     person.setName(name);
@@ -201,16 +201,16 @@
       _removeChildren(ID, false);
   }
 
-  public URI getId() throws URISyntaxException {
+  public IRI getId() throws IRISyntaxException {
     IRIElement id = getIdElement();
     return (id != null) ? id.getValue() : null;
   }
   
-  public IRIElement setId(String value) throws URISyntaxException {
+  public IRIElement setId(String value) throws IRISyntaxException {
     return setId(value, false);
   }
     
-  public IRIElement setId(String value, boolean normalize) throws URISyntaxException {
+  public IRIElement setId(String value, boolean normalize) throws IRISyntaxException {
     if (value == null) {
       _removeChildren(ID, false);
       return null;
@@ -240,11 +240,11 @@
     addChild((OMElement)link);
   }
 
-  public Link addLink(String href) throws URISyntaxException {
+  public Link addLink(String href) throws IRISyntaxException {
     return addLink(href, null);
   }
   
-  public Link addLink(String href, String rel) throws URISyntaxException {
+  public Link addLink(String href, String rel) throws IRISyntaxException {
     FOMFactory fomfactory = (FOMFactory) factory;
     Link link = fomfactory.newLink(this);
     link.setHref(href);
@@ -252,7 +252,7 @@
     return link;    
   }
   
-  public Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws URISyntaxException, MimeTypeParseException {
+  public Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws IRISyntaxException, MimeTypeParseException {
     FOMFactory fomfactory = (FOMFactory) factory;
     Link link = fomfactory.newLink(this);
     link.setHref(href);
@@ -455,7 +455,7 @@
     String uri, 
     String version, 
     String value) 
-      throws URISyntaxException {
+      throws IRISyntaxException {
     FOMFactory fomfactory = (FOMFactory) factory;
     Generator generator = fomfactory.newGenerator(this);
     if (uri != null) generator.setUri(uri);
@@ -475,7 +475,7 @@
       _removeChildren(ICON, false);
   }
 
-  public IRIElement setIcon(String value) throws URISyntaxException {
+  public IRIElement setIcon(String value) throws IRISyntaxException {
     if (value == null) {
       _removeChildren(ICON, false);
       return null;
@@ -486,9 +486,9 @@
     return iri;
   }
   
-  public URI getIcon() throws URISyntaxException {
+  public IRI getIcon() throws IRISyntaxException {
     IRIElement iri = getIconElement();
-    URI uri = (iri != null) ? iri.getResolvedValue() : null;
+    IRI uri = (iri != null) ? iri.getResolvedValue() : null;
     return (URIHelper.isJavascriptUri(uri) ||
         URIHelper.isMailtoUri(uri)) ? null : uri;
   }
@@ -504,7 +504,7 @@
       _removeChildren(LOGO, false);
   }
 
-  public IRIElement setLogo(String value) throws URISyntaxException {
+  public IRIElement setLogo(String value) throws IRISyntaxException {
     if (value == null) {
       _removeChildren(LOGO, false);
       return null;
@@ -515,9 +515,9 @@
     return iri;
   }
   
-  public URI getLogo() throws URISyntaxException {
+  public IRI getLogo() throws IRISyntaxException {
     IRIElement iri = getLogoElement();
-    URI uri = (iri != null) ? iri.getResolvedValue() : null;
+    IRI uri = (iri != null) ? iri.getResolvedValue() : null;
     return (URIHelper.isJavascriptUri(uri) ||
         URIHelper.isMailtoUri(uri)) ? null : uri;
   }
@@ -537,15 +537,15 @@
     return getLink(Link.REL_ALTERNATE);
   }
 
-  public URI getLinkResolvedHref(String rel) throws URISyntaxException {
+  public IRI getLinkResolvedHref(String rel) throws IRISyntaxException {
     Link link = getLink(rel);
     return (link != null) ? link.getResolvedHref() : null;
   }
-  public URI getSelfLinkResolvedHref() throws URISyntaxException {
+  public IRI getSelfLinkResolvedHref() throws IRISyntaxException {
     Link link = getSelfLink();
     return (link != null) ? link.getResolvedHref() : null;
   }
-  public URI getAlternateLinkResolvedHref() throws URISyntaxException {
+  public IRI getAlternateLinkResolvedHref() throws IRISyntaxException {
     Link link = getAlternateLink();
     return (link != null) ? link.getResolvedHref() : null;
   }
@@ -583,10 +583,10 @@
     return selectLink(getLinks(Link.REL_ALTERNATE), type, hreflang);
   }
 
-  public java.net.URI getAlternateLinkResolvedHref(
+  public IRI getAlternateLinkResolvedHref(
     String type, 
     String hreflang) 
-      throws URISyntaxException, 
+      throws IRISyntaxException, 
              MimeTypeParseException {
     Link link = getAlternateLink(type, hreflang);
     return (link != null) ? link.getResolvedHref() : null;

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,15 +17,14 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.model.Div;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.Text;
 import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -136,12 +135,13 @@
       } else if (Type.HTML.equals(type)) {
         super.setText(value);
       } else if (Type.XHTML.equals(type)) {
-        URI baseUri = null;
+        IRI baseUri = null;
+        value = "<div xmlns=\"" + XHTML_NS + "\">" + value + "</div>";
+        Element element = null;
         try {
           baseUri = getResolvedBaseUri();
+          element = _parse(value, baseUri);
         } catch (Exception e) {}
-        value = "<div xmlns=\"" + XHTML_NS + "\">" + value + "</div>";
-        Element element = _parse(value, baseUri);
         if (element != null && element instanceof Div)
           setValueElement((Div)element);
       }
@@ -159,11 +159,13 @@
 
   public void setWrappedValue(String wrappedValue) {
     if (Type.XHTML.equals(type)) {
-      URI baseUri = null;
+      IRI baseUri = null;
+      Element element = null;
       try {
         baseUri = getResolvedBaseUri();
+        element = _parse(wrappedValue, baseUri);
       } catch (Exception e) {}
-      Element element = _parse(wrappedValue, baseUri);
+      
       if (element != null && element instanceof Div)
         setValueElement((Div)element);
     } else {
@@ -172,8 +174,8 @@
   }
 
   @Override
-  public URI getBaseUri()
-    throws URISyntaxException {
+  public IRI getBaseUri()
+    throws IRISyntaxException {
       if (Type.XHTML.equals(type)) {
         Element el = getValueElement();
         if (el != null) {
@@ -190,8 +192,8 @@
   }
 
   @Override
-  public URI getResolvedBaseUri()
-    throws URISyntaxException {
+  public IRI getResolvedBaseUri()
+    throws IRISyntaxException {
       if (Type.XHTML.equals(type)) {
         Element el = getValueElement();
         if (el != null) {

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -17,7 +17,6 @@
 */
 package org.apache.abdera.parser.stax;
 
-import java.net.URISyntaxException;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -26,6 +25,7 @@
 import org.apache.abdera.model.Text;
 import org.apache.abdera.model.Workspace;
 import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
@@ -138,7 +138,7 @@
     addChild((OMElement)collection);
   }
 
-  public Collection addCollection(String title, String href) throws URISyntaxException {
+  public Collection addCollection(String title, String href) throws IRISyntaxException {
     FOMFactory fomfactory = (FOMFactory) factory;
     Collection collection = fomfactory.newCollection(this);
     collection.setTitle(title);

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/ResolveFunction.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/ResolveFunction.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/ResolveFunction.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/ResolveFunction.java Fri Sep 29 14:22:50 2006
@@ -17,7 +17,6 @@
 */
 package org.apache.abdera.parser.stax.util;
 
-import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -25,6 +24,7 @@
 
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
+import org.apache.abdera.util.iri.IRI;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMNode;
@@ -39,7 +39,7 @@
   public static final QName QNAME = new QName("http://incubator.apache.org/abdera", "resolve");
   
   public Object call(Context context, List args) throws FunctionCallException {
-    List<URI> results = new ArrayList<URI>();
+    List<IRI> results = new ArrayList<IRI>();
     if (args.isEmpty()) return null;
     Navigator navigator = context.getNavigator();
     for(Object obj : args) {
@@ -47,8 +47,8 @@
         for (Object o : (List)obj) {
           try {
             String value = StringFunction.evaluate(o, navigator);
-            URI resolved = null;
-            URI baseUri = null;
+            IRI resolved = null;
+            IRI baseUri = null;
             if (o instanceof OMNode) {
               OMNode node = (OMNode) o;
               OMContainer el = node.getParent();

Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java (original)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java Fri Sep 29 14:22:50 2006
@@ -17,7 +17,6 @@
 */
 package org.apache.abdera.test.parser.stax;
 
-import java.net.URI;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -29,13 +28,14 @@
 import org.apache.abdera.model.Feed;
 import org.apache.abdera.model.Link;
 import org.apache.abdera.model.Text;
+import org.apache.abdera.util.iri.IRI;
 import org.apache.axiom.om.OMElement;
 
 public class AtomConformanceTest extends BaseParserTestCase {
   
-  private static Document<Feed> get(URI uri) {
+  private static Document<Feed> get(IRI uri) {
     try {
-      return getParser().parse(uri.toURL().openStream(), uri);
+      return getParser().parse(uri.toURL().openStream(), uri.toString());
     } catch (Exception e) {}
     return null;
   }
@@ -45,7 +45,7 @@
    * extended content types allowed by Atom
    */
   public static void testContentTypes() throws Exception {
-    URI uri = new URI("http://www.snellspace.com/public/contentsummary.xml");
+    IRI uri = new IRI("http://www.snellspace.com/public/contentsummary.xml");
     Document<Feed> doc = parse(uri);
     Feed feed = doc.getRoot();
     int n = 1;
@@ -106,7 +106,7 @@
     };
     int n = 1;
     for (String test : tests) {
-      URI uri = new URI(test);
+      IRI uri = new IRI(test);
       Document<Feed> doc = get(uri);
       assertNotNull(doc);
       Feed feed = doc.getRoot();
@@ -115,7 +115,7 @@
         case 1:
           assertNotNull(entry.getTitleElement());
           assertEquals(entry.getIdElement().getValue(), 
-              new URI("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"));
+              new IRI("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"));
           Content content = entry.getContentElement();
           assertNotNull(content);
           assertEquals(content.getContentType(), Content.Type.XHTML);
@@ -128,7 +128,7 @@
         case 2:
           assertNotNull(entry.getTitleElement());
           assertEquals(entry.getIdElement().getValue(), 
-              new URI("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"));
+              new IRI("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"));
           content = entry.getContentElement();
           assertNotNull(content);
           assertEquals(content.getContentType(), Content.Type.XHTML);
@@ -141,7 +141,7 @@
         case 3:
           assertNotNull(entry.getTitleElement());
           assertEquals(entry.getIdElement().getValue(), 
-              new URI("http://hsivonen.iki.fi/test/unknown-namespace.atom/entry"));
+              new IRI("http://hsivonen.iki.fi/test/unknown-namespace.atom/entry"));
           content = entry.getContentElement();
           assertNotNull(content);
           assertEquals(content.getContentType(), Content.Type.XHTML);
@@ -154,7 +154,7 @@
         case 4:
           assertNotNull(entry.getTitleElement());
           assertEquals(entry.getIdElement().getValue(), 
-              new URI("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"));
+              new IRI("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"));
           content = entry.getContentElement();
           assertNotNull(content);
           assertEquals(content.getContentType(), Content.Type.XHTML);
@@ -174,13 +174,13 @@
    */
   public static void testXmlBase() throws Exception {
     //http://tbray.org/ongoing/ongoing.atom
-    URI uri = new URI("http://www.tbray.org/ongoing/ongoing.atom");
+    IRI uri = new IRI("http://www.tbray.org/ongoing/ongoing.atom");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
-    assertEquals(feed.getBaseUri(), new URI("http://www.tbray.org/ongoing/ongoing.atom"));
-    assertEquals(feed.getLogoElement().getResolvedValue(), new URI("http://www.tbray.org/ongoing/rsslogo.jpg"));
-    assertEquals(feed.getIconElement().getResolvedValue(),new URI("http://www.tbray.org/favicon.ico"));    
+    assertEquals(feed.getBaseUri(), new IRI("http://www.tbray.org/ongoing/ongoing.atom"));
+    assertEquals(feed.getLogoElement().getResolvedValue(), new IRI("http://www.tbray.org/ongoing/rsslogo.jpg"));
+    assertEquals(feed.getIconElement().getResolvedValue(),new IRI("http://www.tbray.org/favicon.ico"));    
   }
   
   /**
@@ -188,8 +188,8 @@
    */
   public static void testXmlBase2() throws Exception {
     //http://plasmasturm.org/attic/atom-tests/xmlbase.atom
-    URI uri = new URI("http://plasmasturm.org/attic/atom-tests/xmlbase.atom");
-    URI result = new URI("http://example.org/tests/base/result.html");
+    IRI uri = new IRI("http://plasmasturm.org/attic/atom-tests/xmlbase.atom");
+    IRI result = new IRI("http://example.org/tests/base/result.html");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
@@ -251,7 +251,7 @@
       "text-ncr.atom",
       "xhtml-entity.atom",
       "xhtml-ncr.atom"};
-    URI baseUri = new URI("http://atomtests.philringnalda.com/tests/item/title/");
+    IRI baseUri = new IRI("http://atomtests.philringnalda.com/tests/item/title/");
     int n = 1;
     for (String test : tests) {
       Document<Feed> doc = get(baseUri.resolve(test));
@@ -314,7 +314,7 @@
    */
   public static void testOrder() throws Exception {
     //http://www.snellspace.com/public/ordertest.xml
-    URI uri = new URI("http://www.snellspace.com/public/ordertest.xml");
+    IRI uri = new IRI("http://www.snellspace.com/public/ordertest.xml");
     Document<Feed> doc = parse(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
@@ -323,14 +323,14 @@
     for (Entry entry : entries ) {
       switch(n) {
         case 1:
-          assertEquals(entry.getIdElement().getValue(), new URI("tag:example.org,2006:atom/conformance/element_order/1"));
+          assertEquals(entry.getIdElement().getValue(), new IRI("tag:example.org,2006:atom/conformance/element_order/1"));
           assertEquals(entry.getTitleType(), Text.Type.TEXT);
           assertEquals(entry.getSummaryType(), Text.Type.TEXT);
           assertNotNull(entry.getUpdatedElement().getValue());
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
           break;
         case 2:
-          assertEquals(entry.getIdElement().getValue(), new URI("tag:example.org,2006:atom/conformance/element_order/2"));
+          assertEquals(entry.getIdElement().getValue(), new IRI("tag:example.org,2006:atom/conformance/element_order/2"));
           assertEquals(entry.getTitleType(), Text.Type.TEXT);
           assertEquals(entry.getSummaryType(), Text.Type.TEXT);
           assertNotNull(entry.getUpdatedElement().getValue());
@@ -340,16 +340,16 @@
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),2);
           assertEquals(
             entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-            new URI("http://www.snellspace.com/public/alternate"));
+            new IRI("http://www.snellspace.com/public/alternate"));
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(1).getHref(), 
-              new URI("http://www.snellspace.com/public/alternate2"));
+              new IRI("http://www.snellspace.com/public/alternate2"));
           break;
         case 4:
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/alternate"));
+              new IRI("http://www.snellspace.com/public/alternate"));
           break;
         case 5:
           Text title = entry.getTitleElement();
@@ -359,7 +359,7 @@
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/alternate"));          
+              new IRI("http://www.snellspace.com/public/alternate"));          
           break;
         case 6:
           title = entry.getTitleElement();
@@ -369,7 +369,7 @@
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/alternate"));
+              new IRI("http://www.snellspace.com/public/alternate"));
           break;
         case 7:
           title = entry.getTitleElement();
@@ -379,7 +379,7 @@
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/alternate"));          
+              new IRI("http://www.snellspace.com/public/alternate"));          
           break;
         case 8:
           title = entry.getTitleElement();
@@ -388,7 +388,7 @@
           assertEquals(value, "Atom elements in an extension element");
           assertEquals(
             entry.getIdElement().getValue(), 
-            new URI("tag:example.org,2006:atom/conformance/element_order/8"));
+            new IRI("tag:example.org,2006:atom/conformance/element_order/8"));
           break;
         case 9:
           title = entry.getTitleElement();
@@ -397,7 +397,7 @@
           assertEquals(value, "Atom elements in an extension element");
           assertEquals(
             entry.getIdElement().getValue(), 
-            new URI("tag:example.org,2006:atom/conformance/element_order/9"));
+            new IRI("tag:example.org,2006:atom/conformance/element_order/9"));
           break;
       }
       n++;
@@ -409,7 +409,7 @@
    */
   public static void testLink() throws Exception {
     //http://www.snellspace.com/public/linktests.xml
-    URI uri = new URI("http://www.snellspace.com/public/linktests.xml");
+    IRI uri = new IRI("http://www.snellspace.com/public/linktests.xml");
     Document<Feed> doc = parse(uri);
     assertNotNull(doc);
     Feed feed = doc.getRoot();
@@ -421,16 +421,16 @@
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
           assertEquals(
             entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-            new URI("http://www.snellspace.com/public/linktests/alternate"));
+            new IRI("http://www.snellspace.com/public/linktests/alternate"));
           break;
         case 2:
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),4);
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(1).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/alternate"));          
+              new IRI("http://www.snellspace.com/public/linktests/alternate"));          
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(2).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/alternate2"));
+              new IRI("http://www.snellspace.com/public/linktests/alternate2"));
           break;
         case 3:
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
@@ -440,19 +440,19 @@
           assertEquals(entry.getLinks(Link.REL_VIA).size(),1);    
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/alternate"));
+              new IRI("http://www.snellspace.com/public/linktests/alternate"));
           assertEquals(
               entry.getLinks(Link.REL_ENCLOSURE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/enclosure"));
+              new IRI("http://www.snellspace.com/public/linktests/enclosure"));
           assertEquals(
               entry.getLinks(Link.REL_RELATED).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/related"));
+              new IRI("http://www.snellspace.com/public/linktests/related"));
           assertEquals(
               entry.getLinks(Link.REL_SELF).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/self"));
+              new IRI("http://www.snellspace.com/public/linktests/self"));
           assertEquals(
               entry.getLinks(Link.REL_VIA).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/via"));
+              new IRI("http://www.snellspace.com/public/linktests/via"));
           break;
         case 4:
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),2);
@@ -462,42 +462,42 @@
           assertEquals(entry.getLinks(Link.REL_VIA).size(),1);          
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/alternate"));
+              new IRI("http://www.snellspace.com/public/linktests/alternate"));
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(1).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/alternate2"));
+              new IRI("http://www.snellspace.com/public/linktests/alternate2"));
           assertEquals(
               entry.getLinks(Link.REL_ENCLOSURE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/enclosure"));
+              new IRI("http://www.snellspace.com/public/linktests/enclosure"));
           assertEquals(
               entry.getLinks(Link.REL_RELATED).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/related"));
+              new IRI("http://www.snellspace.com/public/linktests/related"));
           assertEquals(
               entry.getLinks(Link.REL_SELF).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/self"));
+              new IRI("http://www.snellspace.com/public/linktests/self"));
           assertEquals(
               entry.getLinks(Link.REL_VIA).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/via"));
+              new IRI("http://www.snellspace.com/public/linktests/via"));
           break;
         case 5:
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
           assertEquals(entry.getLinks(Link.REL_LICENSE).size(),1);  
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/alternate"));
+              new IRI("http://www.snellspace.com/public/linktests/alternate"));
           assertEquals(
               entry.getLinks(Link.REL_LICENSE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/license"));
+              new IRI("http://www.snellspace.com/public/linktests/license"));
           break;
         case 6:
           assertEquals(entry.getLinks(Link.REL_ALTERNATE).size(),1);
           assertEquals(entry.getLinks("http://example.org").size(),1);
           assertEquals(
               entry.getLinks(Link.REL_ALTERNATE).get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/alternate"));
+              new IRI("http://www.snellspace.com/public/linktests/alternate"));
           assertEquals(
               entry.getLinks("http://example.org").get(0).getHref(), 
-              new URI("http://www.snellspace.com/public/linktests/example"));
+              new IRI("http://www.snellspace.com/public/linktests/example"));
           break;
       }
       n++;

Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java (original)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java Fri Sep 29 14:22:50 2006
@@ -23,9 +23,9 @@
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.parser.Parser;
+import org.apache.abdera.util.iri.IRI;
 
 import java.io.InputStream;
-import java.net.URI;
 
 public abstract class BaseParserTestCase extends TestCase {
 
@@ -35,16 +35,16 @@
     return abdera.getParser();
   }
   
-  protected static <T extends Element>Document<T> parse(URI uri) {
+  protected static <T extends Element>Document<T> parse(IRI uri) {
     try {
       String uriStr = uri.toString();
       String path = uriStr.substring(uriStr.indexOf("//") + 1);
       InputStream stream = BaseParserTestCase.class.getResourceAsStream(path);
-      return getParser().parse(stream, uri);
+      return getParser().parse(stream, uri.toString());
     } catch (Exception e) {
       // when getting it local fails, fall back to getting it from the server
       try {
-        return getParser().parse(uri.toURL().openStream(), uri);
+        return getParser().parse(uri.toURL().openStream(), uri.toString());
       } catch (Exception ex) {}
     }
     return null;

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?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -187,7 +187,7 @@
     URL url = FOMTest.class.getResource("/simple.xml");
     InputStream in = url.openStream();
 
-    Document<Feed> doc = getParser().parse(in, url.toURI(), options);
+    Document<Feed> doc = getParser().parse(in, url.toString(), options);
     Feed feed = doc.getRoot();
     
     assertEquals(feed.getTitle(),"Example Feed");
@@ -218,7 +218,7 @@
     URL url = FOMTest.class.getResource("/simple.xml");
     InputStream in = url.openStream();
 
-    Document<Feed> doc = getParser().parse(in, url.toURI(), options);
+    Document<Feed> doc = getParser().parse(in, url.toString(), options);
     Feed feed = doc.getRoot();
     
     assertEquals(feed.getTitle(),"Example Feed");
@@ -262,7 +262,7 @@
     
     URL url = FOMTest.class.getResource("/simple.xml");
     InputStream in = url.openStream();
-    Document<Feed> doc = getParser().parse(in, url.toURI(), options);
+    Document<Feed> doc = getParser().parse(in, url.toString(), options);
     Feed feed = doc.getRoot();
     
     assertEquals(feed.getTitle(),"Example Feed");

Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java (original)
+++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java Fri Sep 29 14:22:50 2006
@@ -20,7 +20,6 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
-import java.net.URI;
 
 import javax.activation.DataHandler;
 
@@ -29,13 +28,14 @@
 import org.apache.abdera.model.Entry;
 import org.apache.abdera.model.Feed;
 import org.apache.abdera.model.Person;
+import org.apache.abdera.util.iri.IRI;
 
 public class FeedParserTest extends BaseParserTestCase {
 
-  static URI baseURI;
+  static IRI baseURI;
 
   protected void setUp() throws Exception {
-    baseURI = new URI("http://www.feedparser.org/tests/wellformed/atom10/");
+    baseURI = new IRI("http://www.feedparser.org/tests/wellformed/atom10/");
   }
 
   public void testAtom10Namespace() throws Exception {



Mime
View raw message