# AbstractSiteMap (Crawler-commons 0.10 API)
Date: 2018-06-05

crawlercommons.sitemaps

## Class AbstractSiteMap

- java.lang.Object
- - crawlercommons.sitemaps.AbstractSiteMap

Direct Known Subclasses:
  SiteMap, SiteMapIndex

    public abstract class AbstractSiteMap
    extends Object

SiteMap or SiteMapIndex

### Nested Class Summary

Nested Classes
`static class` `AbstractSiteMap.SitemapType` Various Sitemap types

### Field Summary

Fields
`protected URL` `url`

### Constructor Summary

Constructors
Constructor and Description
`AbstractSiteMap()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static Date` `convertToDate(String date)` Convert the given date (given in an acceptable DateFormat), null if the date is not in the correct format.
`static DateFormat` `getFullDateFormat()`
`Date` `getLastModified()`
`AbstractSiteMap.SitemapType` `getType()`
`URL` `getUrl()`
`boolean` `isIndex()`
`boolean` `isProcessed()`
`static String` `normalizeRSSTimestamp(String pubDate)` Converts pubDate of RSS to the string representation which could be parsed in `convertToDate(String)` method.
`void` `setLastModified(Date lastModified)`
`void` `setLastModified(String lastModified)`
`void` `setProcessed(boolean processed)`
`void` `setType(AbstractSiteMap.SitemapType type)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### url

    protected URL url

### Constructor Detail

#### AbstractSiteMap

    public AbstractSiteMap()

### Method Detail

#### getFullDateFormat

    public static DateFormat getFullDateFormat()

#### isIndex

    public boolean isIndex()

#### getUrl

    public URL getUrl()

Returns:
  the URL of the Sitemap

#### setType

    public void setType(AbstractSiteMap.SitemapType type)

Parameters:
  `type` - the Sitemap type to set

#### getType

    public AbstractSiteMap.SitemapType getType()

Returns:
  the Sitemap type

#### setProcessed

    public void setProcessed(boolean processed)

Parameters:
  `processed` - - indicate if the Sitemap has been processed.

#### isProcessed

    public boolean isProcessed()

Returns:
  true if the Sitemap has been processed i.e it contains at least one SiteMapURL

#### setLastModified

    public void setLastModified(Date lastModified)

Parameters:
  `lastModified` - - the lastModified to set

#### setLastModified

    public void setLastModified(String lastModified)

Parameters:
  `lastModified` - - the lastModified to set

#### getLastModified

    public Date getLastModified()

Returns:
  the lastModified date of the Sitemap

#### convertToDate

    public static Date convertToDate(String date)

Convert the given date (given in an acceptable DateFormat), null if the date is not in the correct format.

Parameters:
  `date` - - the date to be parsed
Returns:
  the Date equivalent or NULL when encountering an unparsable date string argument

#### normalizeRSSTimestamp

    public static String normalizeRSSTimestamp(String pubDate)

Converts pubDate of RSS to the string representation which could be parsed in `convertToDate(String)` method.

Parameters:
  `pubDate` - - date time of pubDate in RFC822
Returns:
  converted to "yyyy-MM-dd'T'HH:mm:ssZ" format or original value if it doesn't follow the RFC822