public abstract class LinkHandlerFactory extends Object
Constructor and Description |
---|
LinkHandlerFactory() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptUrl(String url)
When a VIEW_ACTION is caught this function will test if the url delivered within the calling
Intent was meant to be watched with this Service.
|
LinkHandler |
fromId(String id) |
LinkHandler |
fromId(String id,
String baseUrl) |
LinkHandler |
fromUrl(String url)
Builds a
LinkHandler from a url.Be sure to call Utils.followGoogleRedirectIfNeeded(String) on the url if overriding
this function. |
LinkHandler |
fromUrl(String url,
String baseUrl)
Builds a
LinkHandler from an URL and a base URL. |
abstract String |
getId(String url) |
abstract String |
getUrl(String id) |
String |
getUrl(String id,
String baseUrl) |
abstract boolean |
onAcceptUrl(String url) |
public abstract String getId(String url) throws ParsingException
ParsingException
public abstract String getUrl(String id) throws ParsingException
ParsingException
public abstract boolean onAcceptUrl(String url) throws ParsingException
ParsingException
public String getUrl(String id, String baseUrl) throws ParsingException
ParsingException
public LinkHandler fromUrl(String url) throws ParsingException
LinkHandler
from a url.Utils.followGoogleRedirectIfNeeded(String)
on the url if overriding
this function.url
- the url to extract path and id fromLinkHandler
complete with informationParsingException
public LinkHandler fromUrl(String url, String baseUrl) throws ParsingException
LinkHandler
from an URL and a base URL. The URL is expected to be already
polished from Google search redirects (otherwise how could baseUrl
have been
extracted?).Utils.followGoogleRedirectIfNeeded(String)
on the URL if overriding
this function, since that should be done in fromUrl(String)
.url
- the URL without Google search redirects to extract id frombaseUrl
- the base URLLinkHandler
complete with informationParsingException
public LinkHandler fromId(String id) throws ParsingException
ParsingException
public LinkHandler fromId(String id, String baseUrl) throws ParsingException
ParsingException
public boolean acceptUrl(String url) throws ParsingException
ParsingException