Package crawlercommons.sitemaps
Class SiteMapURL
- java.lang.Object
- 
- crawlercommons.sitemaps.SiteMapURL
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class SiteMapURL extends Object implements Serializable The SitemapUrl class represents a URL found in a Sitemap.- Author:
- fmccown
- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSiteMapURL.ChangeFrequencyAllowed change frequencies
 - 
Field SummaryFields Modifier and Type Field Description static doubleDEFAULT_PRIORITY
 - 
Constructor SummaryConstructors Constructor Description SiteMapURL(String url, boolean valid)SiteMapURL(String url, String lastModified, String changeFreq, String priority, boolean valid)SiteMapURL(URL url, boolean valid)SiteMapURL(URL url, ZonedDateTime lastModified, SiteMapURL.ChangeFrequency changeFreq, double priority, boolean valid)SiteMapURL(URL url, Date lastModified, SiteMapURL.ChangeFrequency changeFreq, double priority, boolean valid)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttributesForExtension(Extension extension, ExtensionMetadata[] attributes)Add attributes of a specific sitemap extensionbooleanequals(Object o)Map<Extension,ExtensionMetadata[]>getAttributes()Get attributes of sitemap extensions (news, images, videos, etc.)ExtensionMetadata[]getAttributesForExtension(Extension extension)Get attributes of a specific sitemap extensionSiteMapURL.ChangeFrequencygetChangeFrequency()Return the URL's change frequencyDategetLastModified()Return when this URL was last modified.doublegetPriority()Return this URL's priority (a value between [0.0 - 1.0]).URLgetUrl()Return the URL.inthashCode()booleanisValid()Is the siteMapURL under the base url ?voidsetChangeFrequency(SiteMapURL.ChangeFrequency changeFreq)Set the URL's change frequencyvoidsetChangeFrequency(String changeFreq)Set the URL's change frequency In case of a bad ChangeFrequency, the current frequency in this instance will be set to NULLvoidsetLastModified(String lastModified)Set when this URL was last modified.voidsetLastModified(ZonedDateTime lastModified)Set when this URL was last modified.voidsetLastModified(Date lastModified)Set when this URL was last modified.voidsetPriority(double priority)Set the URL's priority to a value between [0.0 - 1.0] (Default Priority is used if the given priority is out of range).voidsetPriority(String priorityStr)Set the URL's priority to a value between [0.0 - 1.0] (Default Priority is used if the given priority missing or is out of range).voidsetUrl(String url)Set the URL.voidsetUrl(URL url)Set the URL.voidsetValid(boolean valid)Valid means that it follows the official guidelines that the siteMapURL must be under the base urlStringtoString()
 
- 
- 
- 
Field Detail- 
DEFAULT_PRIORITYpublic static final double DEFAULT_PRIORITY - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
SiteMapURLpublic SiteMapURL(String url, boolean valid) 
 - 
SiteMapURLpublic SiteMapURL(URL url, boolean valid) 
 - 
SiteMapURLpublic SiteMapURL(String url, String lastModified, String changeFreq, String priority, boolean valid) 
 - 
SiteMapURLpublic SiteMapURL(URL url, Date lastModified, SiteMapURL.ChangeFrequency changeFreq, double priority, boolean valid) 
 - 
SiteMapURLpublic SiteMapURL(URL url, ZonedDateTime lastModified, SiteMapURL.ChangeFrequency changeFreq, double priority, boolean valid) 
 
- 
 - 
Method Detail- 
getUrlpublic URL getUrl() Return the URL.- Returns:
- URL
 
 - 
setUrlpublic void setUrl(URL url) Set the URL.- Parameters:
- url- of the sitemap
 
 - 
setUrlpublic void setUrl(String url) Set the URL.- Parameters:
- url- In case of Malformed URL, the current url in this instance will be set to NULL
 
 - 
getLastModifiedpublic Date getLastModified() Return when this URL was last modified.- Returns:
- last modified date
 
 - 
setLastModifiedpublic void setLastModified(String lastModified) Set when this URL was last modified.- Parameters:
- lastModified- lastmod specified for the URL
 
 - 
setLastModifiedpublic void setLastModified(Date lastModified) Set when this URL was last modified.- Parameters:
- lastModified- lastmod specified for the URL
 
 - 
setLastModifiedpublic void setLastModified(ZonedDateTime lastModified) Set when this URL was last modified.- Parameters:
- lastModified- lastmod specified for the URL
 
 - 
getPrioritypublic double getPriority() Return this URL's priority (a value between [0.0 - 1.0]).- Returns:
- URL's priority (a value between [0.0 - 1.0])
 
 - 
setPrioritypublic void setPriority(double priority) Set the URL's priority to a value between [0.0 - 1.0] (Default Priority is used if the given priority is out of range).- Parameters:
- priority- a value between [0.0 - 1.0]
 
 - 
setPrioritypublic void setPriority(String priorityStr) Set the URL's priority to a value between [0.0 - 1.0] (Default Priority is used if the given priority missing or is out of range).- Parameters:
- priorityStr- a value between [0.0 - 1.0]
 
 - 
getChangeFrequencypublic SiteMapURL.ChangeFrequency getChangeFrequency() Return the URL's change frequency- Returns:
- the URL's change frequency
 
 - 
setChangeFrequencypublic void setChangeFrequency(SiteMapURL.ChangeFrequency changeFreq) Set the URL's change frequency- Parameters:
- changeFreq- a- SiteMapURL.ChangeFrequencyfor this sitemap
 
 - 
setChangeFrequencypublic void setChangeFrequency(String changeFreq) Set the URL's change frequency In case of a bad ChangeFrequency, the current frequency in this instance will be set to NULL- Parameters:
- changeFreq- a string representing a- SiteMapURL.ChangeFrequencyfor this sitemap
 
 - 
setValidpublic void setValid(boolean valid) Valid means that it follows the official guidelines that the siteMapURL must be under the base url- Parameters:
- valid- whether the Sitemap is valid syntax or not
 
 - 
isValidpublic boolean isValid() Is the siteMapURL under the base url ?- Returns:
- true if the syntax is valid, false otherwise
 
 - 
addAttributesForExtensionpublic void addAttributesForExtension(Extension extension, ExtensionMetadata[] attributes) Add attributes of a specific sitemap extension- Parameters:
- extension- sitemap extension (news, images, videos, etc.)
- attributes- array of attributes
 
 - 
getAttributespublic Map<Extension,ExtensionMetadata[]> getAttributes() Get attributes of sitemap extensions (news, images, videos, etc.)- Returns:
- attribute map or null if no extensions are used
 
 - 
getAttributesForExtensionpublic ExtensionMetadata[] getAttributesForExtension(Extension extension) Get attributes of a specific sitemap extension- Parameters:
- extension- sitemap extension (news, images, videos, etc.)
- Returns:
- array of attributes or null if there are no attributes for the given extension
 
 
- 
 
-