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 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.static RssGeneratorof(String baseUrl)Helper method to create an instance of SitemapGeneratorstatic RssGeneratorof(String baseUrl, boolean root, String webTitle, String webDescription)Helper method to create an instance of SitemapGeneratorstatic RssGeneratorof(String baseUrl, String webTitle, String webDescription)Helper method to create an instance of SitemapGeneratorRssGeneratorwebDescription(String webDescription)RssGeneratorwebTitle(String webTitle)
-
-
-
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-- Returns:
-
of
public static RssGenerator of(String baseUrl, String webTitle, String webDescription)
Helper method to create an instance of SitemapGenerator- Parameters:
baseUrl-- Returns:
-
of
public static RssGenerator of(String baseUrl)
Helper method to create an instance of SitemapGenerator- Parameters:
baseUrl-- Returns:
-
webTitle
public RssGenerator webTitle(String webTitle)
-
webDescription
public RssGenerator webDescription(String webDescription)
-
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
-
-