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)Create RssGeneratorRssGenerator(String baseUrl, String webTitle, String webDescription)Create RssGenerator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RssGeneratoraddPage(WebPage webPage)Add single page to sitemapRssGeneratoraddPages(Collection<WebPage> webPages)Add collection of pages to sitemap<T> RssGeneratoraddPages(Collection<T> webPages, java.util.function.Function<T,WebPage> mapper)Add collection of pages to sitemapStringconstructRss()This will construct RSS from web pages.
-
-
-
Constructor Detail
-
RssGenerator
public RssGenerator(String baseUrl, boolean root, String webTitle, String webDescription)
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
-
-
Method Detail
-
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:
addPagein classAbstractGenerator- Parameters:
webPage- single page- Returns:
- this
-
addPages
public RssGenerator addPages(Collection<WebPage> webPages)
Add collection of pages to sitemap- Overrides:
addPagesin 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:
addPagesin classAbstractGenerator- Type Parameters:
T- This is the type parameter- Parameters:
webPages- Collection of pagesmapper- Mapper function which transforms some object to WebPage- Returns:
- this
-
-