Class RssGenerator
- java.lang.Object
-
- cz.jiripinkas.jsitemapgenerator.AbstractGenerator<RssGenerator>
-
- cz.jiripinkas.jsitemapgenerator.generator.RssGenerator
-
public class RssGenerator extends AbstractGenerator<RssGenerator>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class cz.jiripinkas.jsitemapgenerator.AbstractGenerator
AbstractGenerator.GeneratorConsumerWithException<T>, AbstractGenerator.RunnableWithException, AbstractGenerator.StringSupplierWithException<S>
-
-
Field Summary
-
Fields inherited from class cz.jiripinkas.jsitemapgenerator.AbstractGenerator
baseUrl, urls
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbeforeAddPageEvent(WebPage webPage)This method is called before adding a page to urls.RssGeneratordefaultDir(String dirName)Sets default prefix dir to name for all subsequent WebPages.RssGeneratordefaultDir(String... dirNames)Sets default prefix dirs to name for all subsequent WebPages.RssGeneratordefaultExtension(String extension)Sets default suffix extension for all subsequent WebPages.static RssGeneratorof(String baseUrl)Helper method to create an instance of SitemapGeneratorstatic RssGeneratorof(String baseUrl, boolean root)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 SitemapGeneratorRssGeneratorresetDefaultDir()Reset default dir valueRssGeneratorresetDefaultExtension()Reset default extension valueStringtoString()This will construct RSS from web pages.RssGeneratorwebDescription(String webDescription)Set Web descriptionRssGeneratorwebTitle(String webTitle)Set Web title-
Methods inherited from class cz.jiripinkas.jsitemapgenerator.AbstractGenerator
addPage, addPage, addPage, addPageNames, addPageNames, addPages, addPages, addPages, addPages, getThis, run, run, toPrettyXmlString
-
-
-
-
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, boolean root)
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)- 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
-
toString
public String toString()
This will construct RSS from web pages. Web pages are sorted using lastMod in descending order (latest is first)
-
beforeAddPageEvent
protected void beforeAddPageEvent(WebPage webPage)
Description copied from class:AbstractGeneratorThis method is called before adding a page to urls. It can be used to change webPage attributes- Overrides:
beforeAddPageEventin classAbstractGenerator<RssGenerator>- Parameters:
webPage- WebPage
-
defaultDir
public RssGenerator defaultDir(String dirName)
Sets default prefix dir to name for all subsequent WebPages. Final name will be "dirName/name"- Parameters:
dirName- Dir name- Returns:
- this
-
defaultDir
public RssGenerator defaultDir(String... dirNames)
Sets default prefix dirs to name for all subsequent WebPages. For dirs: ["a", "b", "c"], the final name will be "a/b/c/name"- Parameters:
dirNames- Dir names- Returns:
- this
-
resetDefaultDir
public RssGenerator resetDefaultDir()
Reset default dir value- Returns:
- this
-
defaultExtension
public RssGenerator defaultExtension(String extension)
Sets default suffix extension for all subsequent WebPages. Final name will be "name.extension"- Parameters:
extension- Extension- Returns:
- this
-
resetDefaultExtension
public RssGenerator resetDefaultExtension()
Reset default extension value- Returns:
- this
-
-