org.apache.maven.plugin.changes
Class FeedGenerator

java.lang.Object
  extended by org.apache.maven.plugin.changes.FeedGenerator

public class FeedGenerator
extends Object

Author:
ltheussl

Constructor Summary
FeedGenerator(Locale locale)
          Initialize feedGenerator for a given locale.
 
Method Summary
 void export(List<Release> releases, String feedType, Writer writer)
          Extract a feed and export it to a Writer.
 String getAuthor()
          The author of the feed.
 DateFormat getDateFormat()
          The DateFormat.
 String getLink()
          The main link of the feed.
 List<String> getSupportedFeedTypes()
          A List of supported feed types.
 String getTitle()
          The title of the feed.
 boolean isSupportedFeedType(String type)
          Determine if a given feed type is supported.
 void setAuthor(String author)
          Set the author of the feed.
 void setDateFormat(DateFormat dateFormat)
          Set the date format.
 void setLink(String link)
          Set the main link of the feed.
 void setTitle(String title)
          Set the title of the feed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeedGenerator

public FeedGenerator(Locale locale)
Initialize feedGenerator for a given locale.

Parameters:
locale - a locale for i18n.
Method Detail

getAuthor

public String getAuthor()
The author of the feed.

Returns:
the author.

setAuthor

public void setAuthor(String author)
Set the author of the feed.

Parameters:
author - not null.

getTitle

public String getTitle()
The title of the feed.

Returns:
the title.

setTitle

public void setTitle(String title)
Set the title of the feed.

Parameters:
title - not null.

getDateFormat

public DateFormat getDateFormat()
The DateFormat.

Returns:
may be null.

setDateFormat

public void setDateFormat(DateFormat dateFormat)
Set the date format. This should match the date format used for the release dates in changes.xml.

Parameters:
dateFormat - may be null.

getLink

public String getLink()
The main link of the feed.

Returns:
the link.

setLink

public void setLink(String link)
Set the main link of the feed.

Parameters:
link - not null.

isSupportedFeedType

public boolean isSupportedFeedType(String type)
Determine if a given feed type is supported. The currently supported values are: "rss_0.9", "rss_0.91N" (RSS 0.91 Netscape), "rss_0.91U" (RSS 0.91 Userland), "rss_0.92", "rss_0.93", "rss_0.94", "rss_1.0", "rss_2.0", "atom_0.3", "atom_1.0".

Parameters:
type - the feed type to check. May be null.
Returns:
true if if the given type is supported by the rome library, false otherwise.

getSupportedFeedTypes

public List<String> getSupportedFeedTypes()
A List of supported feed types.

Returns:
a List of supported feed types.
See Also:
isSupportedFeedType(java.lang.String)

export

public void export(List<Release> releases,
                   String feedType,
                   Writer writer)
            throws IOException
Extract a feed and export it to a Writer.

Parameters:
releases - the List of Releases. Only the last release is used in the feed.
feedType - The type of the feed to generate. See isSupportedFeedType(java.lang.String) for supported values.
writer - a Writer. Note that this is not flushed nor closed upon exit.
Throws:
IOException - if an error occurs during export.


Copyright © 2002–2014 The Apache Software Foundation. All rights reserved.