abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r597718 - in /incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera: util/AbstractStreamWriter.java writer/StreamWriter.java
Date Fri, 23 Nov 2007 18:56:02 GMT
Author: jmsnell
Date: Fri Nov 23 10:56:02 2007
New Revision: 597718

URL: http://svn.apache.org/viewvc?rev=597718&view=rev
Log:
writeBase and writeLanguage methods on the StreamWriter

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractStreamWriter.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/StreamWriter.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractStreamWriter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractStreamWriter.java?rev=597718&r1=597717&r2=597718&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractStreamWriter.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractStreamWriter.java
Fri Nov 23 10:56:02 2007
@@ -23,11 +23,13 @@
 import java.nio.channels.Channels;
 import java.nio.channels.WritableByteChannel;
 import java.util.Date;
+import java.util.Locale;
 
 import javax.activation.DataHandler;
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.lang.Lang;
 import org.apache.abdera.model.AtomDate;
 import org.apache.abdera.model.Content;
 import org.apache.abdera.model.Text;
@@ -838,4 +840,25 @@
   public StreamWriter writeElementText(double value) {
     return writeElementText(Double.toString(value));
   }
+  
+  public StreamWriter writeBase(String iri) {
+    return writeAttribute(Constants.BASE, iri);
+  }
+  
+  public StreamWriter writeBase(IRI iri) {
+    return writeBase(iri.toString());
+  }
+  
+  public StreamWriter writeLanguage(String lang) {
+    return writeAttribute(Constants.LANG, lang);
+  }
+  
+  public StreamWriter writeLanguage(Lang lang) {
+    return writeLanguage(lang.toString());
+  }
+  
+  public StreamWriter writeLanguage(Locale locale) {
+    return writeLanguage(new Lang(locale));
+  }
+
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/StreamWriter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/StreamWriter.java?rev=597718&r1=597717&r2=597718&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/StreamWriter.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/StreamWriter.java
Fri Nov 23 10:56:02 2007
@@ -20,11 +20,13 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Date;
+import java.util.Locale;
 
 import javax.activation.DataHandler;
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.lang.Lang;
 import org.apache.abdera.model.Content;
 import org.apache.abdera.model.Text;
 import org.apache.abdera.util.NamedItem;
@@ -864,5 +866,29 @@
    */
   StreamWriter setAutoIndent(boolean indent);
   
+  /**
+   * Write the xml:base attribute
+   */
+  StreamWriter writeBase(String iri);
+  
+  /**
+   * Write the xml:base attribute
+   */
+  StreamWriter writeBase(IRI iri);
+  
+  /**
+   * Write the xml:lang attribute
+   */
+  StreamWriter writeLanguage(String lang);
+  
+  /**
+   * Write the xml:lang attribute
+   */
+  StreamWriter writeLanguage(Lang lang);
+  
+  /**
+   * Write the xml:lang attribute
+   */
+  StreamWriter writeLanguage(Locale locale);
 }
 



Mime
View raw message