abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Re: svn commit: r596764 - in /incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera: util/AbstractStreamWriter.java writer/StreamWriter.java
Date Tue, 20 Nov 2007 18:53:12 GMT
This is good, but atom:feed isn't the only place we need to have
xml:lang and xml:base support.  With the writeAttribute method, we can
have writeLanguage() and writeBase() methods that set those attributes
wherever they're needed.

  public StreamWriter writeLanguage(String lang) {
    return writeAttribute(Constants.LANG, lang);
  }

  public StreamWriter writeBase(IRI base) {
    return writeBase(base.toString());
  }

  public StreamWriter writeBase(String base) {
    return writeAttribute(Constants.BASE, base);
  }

I can add these if you'd like.

- James

bcm@apache.org wrote:
> Author: bcm
> Date: Tue Nov 20 10:25:52 2007
> New Revision: 596764
> 
> URL: http://svn.apache.org/viewvc?rev=596764&view=rev
> Log:
> add startFeed method variants that allow xml:base to be set
> 
> 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=596764&r1=596763&r2=596764&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
Tue Nov 20 10:25:52 2007
> @@ -79,6 +79,17 @@
>    public StreamWriter startFeed() {
>      return startElement(Constants.FEED);
>    }
> +
> +  public StreamWriter startFeed(IRI base) {
> +    return startFeed(base.toString());
> +  }
> + 
> +  public StreamWriter startFeed(String base) {
> +    StreamWriter sw = startElement(Constants.FEED);
> +    if (base != null)
> +      writeAttribute(Constants.BASE, base);
> +    return sw;
> +  }
>    
>    public StreamWriter endFeed() {
>      return endElement();
> 
> 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=596764&r1=596763&r2=596764&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
Tue Nov 20 10:25:52 2007
> @@ -105,6 +105,18 @@
>    StreamWriter startFeed();
>  
>    /**
> +   * Start an atom:feed element
> +   * @param the xml:base attribute value
> +   */
> +  StreamWriter startFeed(String base);
> +
> +  /**
> +   * Start an atom:feed element
> +   * @param the xml:base attribute value
> +   */
> +  StreamWriter startFeed(IRI base);
> +
> +  /**
>     * End the atom:feed element
>     */
>    StreamWriter endFeed();
> 
> 
> 

Mime
View raw message