Class SitemapGenerator
- java.lang.Object
-
- cz.jiripinkas.jsitemapgenerator.AbstractGenerator
-
- cz.jiripinkas.jsitemapgenerator.AbstractSitemapGenerator
-
- cz.jiripinkas.jsitemapgenerator.generator.SitemapGenerator
-
public class SitemapGenerator extends AbstractSitemapGenerator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSitemapGenerator.AdditionalNamespace
-
Field Summary
-
Fields inherited from class cz.jiripinkas.jsitemapgenerator.AbstractSitemapGenerator
dateFormat
-
Fields inherited from class cz.jiripinkas.jsitemapgenerator.AbstractGenerator
baseUrl, urls
-
-
Constructor Summary
Constructors Constructor Description SitemapGenerator(String baseUrl)SitemapGenerator(String baseUrl, SitemapGenerator.AdditionalNamespace[] additionalNamespaces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SitemapGeneratoraddPage(WebPage webPage)Add single page to sitemapSitemapGeneratoraddPages(Collection<WebPage> webPages)Add collection of pages to sitemap<T> SitemapGeneratoraddPages(Collection<T> webPages, java.util.function.Function<T,WebPage> mapper)Add collection of pages to sitemapString[]constructSitemap()Construct sitemap into array of Strings.-
Methods inherited from class cz.jiripinkas.jsitemapgenerator.AbstractSitemapGenerator
constructAndSaveSitemap, constructSitemapString, pingBing, pingBing, pingGoogle, pingGoogle, saveSitemap
-
-
-
-
Constructor Detail
-
SitemapGenerator
public SitemapGenerator(String baseUrl)
-
SitemapGenerator
public SitemapGenerator(String baseUrl, SitemapGenerator.AdditionalNamespace[] additionalNamespaces)
-
-
Method Detail
-
constructSitemap
public String[] constructSitemap()
Construct sitemap into array of Strings. The URLs will be ordered using priority in descending order (URLs with higher priority will be at the top).- Specified by:
constructSitemapin classAbstractSitemapGenerator- Returns:
- sitemap
-
addPage
public SitemapGenerator addPage(WebPage webPage)
Add single page to sitemap- Overrides:
addPagein classAbstractGenerator- Parameters:
webPage- single page- Returns:
- this
-
addPages
public SitemapGenerator addPages(Collection<WebPage> webPages)
Add collection of pages to sitemap- Overrides:
addPagesin classAbstractGenerator- Parameters:
webPages- Collection of pages- Returns:
- this
-
addPages
public <T> SitemapGenerator 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
-
-