net.sourceforge.pebble.permalink
Class TitlePermalinkProvider
java.lang.Object
net.sourceforge.pebble.permalink.PermalinkProviderSupport
net.sourceforge.pebble.permalink.TitlePermalinkProvider
- All Implemented Interfaces:
- PermalinkProvider
public class TitlePermalinkProvider
- extends PermalinkProviderSupport
Generates permalinks based upon the blog entry title. This implementation
only uses the following characters from the title:
- a-z
- A-Z
- 0-9
- _ (underscore)
For titles without these characters (e.g. those using an extended character
set) the blog entry ID is used for the permalink instead.
- Author:
- Simon Brown
Method Summary |
BlogEntry |
getBlogEntry(java.lang.String uri)
Gets the blog entry referred to by the specified URI. |
java.lang.String |
getPermalink(BlogEntry blogEntry)
Gets the permalink for a blog entry. |
boolean |
isBlogEntryPermalink(java.lang.String uri)
Determines whether the specified URI is a blog entry permalink. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TitlePermalinkProvider
public TitlePermalinkProvider()
getPermalink
public java.lang.String getPermalink(BlogEntry blogEntry)
- Gets the permalink for a blog entry.
- Parameters:
blogEntry
- a BlogEntry instance
- Returns:
- a URI as a String
isBlogEntryPermalink
public boolean isBlogEntryPermalink(java.lang.String uri)
- Determines whether the specified URI is a blog entry permalink.
- Parameters:
uri
- a relative URI
- Returns:
- true if the URI represents a permalink to a blog entry,
false otherwise
getBlogEntry
public BlogEntry getBlogEntry(java.lang.String uri)
- Gets the blog entry referred to by the specified URI.
- Parameters:
uri
- a relative URI
- Returns:
- a BlogEntry instance, or null if one can't be found
Copyright © 2003-2006, Simon Brown. All Rights Reserved.