Package cz.jiripinkas.jsitemapgenerator
Class AbstractGenerator
- java.lang.Object
-
- cz.jiripinkas.jsitemapgenerator.AbstractGenerator
-
- Direct Known Subclasses:
AbstractSitemapGenerator
,RssGenerator
public abstract class AbstractGenerator extends Object
-
-
Constructor Summary
Constructors Constructor Description AbstractGenerator(String baseUrl)
Construct web sitemap.AbstractGenerator(String baseUrl, boolean root)
Construct web sitemap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractGenerator
addPage(WebPage webPage)
Add single page to sitemapAbstractGenerator
addPages(Collection<WebPage> webPages)
Add collection of pages to sitemap<T> AbstractGenerator
addPages(Collection<T> webPages, java.util.function.Function<T,WebPage> mapper)
Add collection of pages to sitemap
-
-
-
Constructor Detail
-
AbstractGenerator
public AbstractGenerator(String baseUrl, boolean root)
Construct web sitemap.- Parameters:
baseUrl
- All URLs must start with this baseUrl, for example http://www.javavids.comroot
- If Base URL is root (for example http://www.javavids.com or if it's some path like http://www.javalibs.com/blog)
-
AbstractGenerator
public AbstractGenerator(String baseUrl)
Construct web sitemap. Root = true.- Parameters:
baseUrl
- All URLs must start with this baseUrl, for example http://www.javavids.com
-
-
Method Detail
-
addPage
public AbstractGenerator addPage(WebPage webPage)
Add single page to sitemap- Parameters:
webPage
- single page- Returns:
- this
-
addPages
public AbstractGenerator addPages(Collection<WebPage> webPages)
Add collection of pages to sitemap- Parameters:
webPages
- Collection of pages- Returns:
- this
-
addPages
public <T> AbstractGenerator addPages(Collection<T> webPages, java.util.function.Function<T,WebPage> mapper)
Add collection of pages to sitemap- Type Parameters:
T
- This is the type parameter- Parameters:
webPages
- Collection of pagesmapper
- Mapper function which transforms some object to WebPage- Returns:
- this
-
-