Class RssGenerator
- java.lang.Object
-
- cz.jiripinkas.jsitemapgenerator.AbstractGenerator
-
- cz.jiripinkas.jsitemapgenerator.generator.RssGenerator
-
public class RssGenerator extends AbstractGenerator
-
-
Field Summary
-
Fields inherited from class cz.jiripinkas.jsitemapgenerator.AbstractGenerator
baseUrl, urls
-
-
Constructor Summary
Constructors Constructor Description RssGenerator(String baseUrl, boolean root, String webTitle, String webDescription)
Deprecated.RssGenerator(String baseUrl, String webTitle, String webDescription)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RssGenerator
addPage(WebPage webPage)
Add single page to sitemapRssGenerator
addPages(Collection<WebPage> webPages)
Add collection of pages to sitemap<T> RssGenerator
addPages(Collection<T> webPages, java.util.function.Function<T,WebPage> mapper)
Add collection of pages to sitemapString
constructRss()
This will construct RSS from web pages.static RssGenerator
of(String baseUrl)
Helper method to create an instance of SitemapGeneratorstatic RssGenerator
of(String baseUrl, boolean root, String webTitle, String webDescription)
Helper method to create an instance of SitemapGeneratorstatic RssGenerator
of(String baseUrl, String webTitle, String webDescription)
Helper method to create an instance of SitemapGeneratorRssGenerator
webDescription(String webDescription)
Set Web descriptionRssGenerator
webTitle(String webTitle)
Set Web title
-
-
-
Constructor Detail
-
RssGenerator
@Deprecated public RssGenerator(String baseUrl, boolean root, String webTitle, String webDescription)
Deprecated.Create RssGenerator- Parameters:
baseUrl
- Base URLroot
- If Base URL is root (for example http://www.javavids.com or if it's some path like http://www.javalibs.com/blog)webTitle
- Web titlewebDescription
- Web description
-
RssGenerator
@Deprecated public RssGenerator(String baseUrl, String webTitle, String webDescription)
Deprecated.Create RssGenerator. Root = true.- Parameters:
baseUrl
- Base URLwebTitle
- Web titlewebDescription
- Web description
-
-
Method Detail
-
of
public static RssGenerator of(String baseUrl, boolean root, String webTitle, String webDescription)
Helper method to create an instance of SitemapGenerator- Parameters:
baseUrl
- Base URLroot
- If Base URL is root (for example http://www.javavids.com or if it's some path like http://www.javalibs.com/blog)webTitle
- Web titlewebDescription
- Web description- Returns:
- Instance of RssGenerator
-
of
public static RssGenerator of(String baseUrl, String webTitle, String webDescription)
Helper method to create an instance of SitemapGenerator- Parameters:
baseUrl
- Base URLwebTitle
- Web titlewebDescription
- Web description- Returns:
- Instance of RssGenerator
-
of
public static RssGenerator of(String baseUrl)
Helper method to create an instance of SitemapGenerator- Parameters:
baseUrl
- Base URL- Returns:
- Instance of RssGenerator
-
webTitle
public RssGenerator webTitle(String webTitle)
Set Web title- Parameters:
webTitle
- Web title- Returns:
- this
-
webDescription
public RssGenerator webDescription(String webDescription)
Set Web description- Parameters:
webDescription
- Web description- Returns:
- this
-
constructRss
public String constructRss()
This will construct RSS from web pages. Web pages are sorted using lastMod in descending order (latest is first)- Returns:
- Constructed RSS
-
addPage
public RssGenerator addPage(WebPage webPage)
Add single page to sitemap- Overrides:
addPage
in classAbstractGenerator
- Parameters:
webPage
- single page- Returns:
- this
-
addPages
public RssGenerator addPages(Collection<WebPage> webPages)
Add collection of pages to sitemap- Overrides:
addPages
in classAbstractGenerator
- Parameters:
webPages
- Collection of pages- Returns:
- this
-
addPages
public <T> RssGenerator addPages(Collection<T> webPages, java.util.function.Function<T,WebPage> mapper)
Add collection of pages to sitemap- Overrides:
addPages
in classAbstractGenerator
- Type Parameters:
T
- This is the type parameter- Parameters:
webPages
- Collection of pagesmapper
- Mapper function which transforms some object to WebPage- Returns:
- this
-
-