|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.pool.RecyclableSupport
org.norther.tammi.core.pool.PoolableSupport
org.norther.tammi.spray.engine.tool.GlobalTool
org.norther.tammi.spray.engine.tool.ContextTool
org.norther.tammi.spray.media.tool.MediaTool
org.norther.tammi.spray.media.tool.LinkTool
public class LinkTool
A request context tool supporting creation of links to media filters.
Based on TemplateLink in the Apache Jakarta Turbine project.
| Constructor Summary | |
|---|---|
LinkTool()
Constructs a new link. |
|
| Method Summary | |
|---|---|
LinkTool |
addPathInfo(List list)
Adds a list of name=value pairs to the path info. |
LinkTool |
addPathInfo(String name,
double value)
Adds a name=value pair to the path info. |
LinkTool |
addPathInfo(String name,
int value)
Adds a name=value pair to the path info. |
LinkTool |
addPathInfo(String name,
long value)
Adds a name=value pair to the path info. |
LinkTool |
addPathInfo(String name,
Object value)
Adds a name=value pair to the path info. |
LinkTool |
addPathInfo(String name,
String value)
Adds a name=value pair to the path info. |
LinkTool |
addQueryString(List list)
Adds a list of name=value pairs to the query string. |
LinkTool |
addQueryString(String name)
Adds a name to the query string. |
LinkTool |
addQueryString(String name,
double value)
Adds a name=value pair to the query string. |
LinkTool |
addQueryString(String name,
int value)
Adds a name=value pair to the query string. |
LinkTool |
addQueryString(String name,
long value)
Adds a name=value pair to the query string. |
LinkTool |
addQueryString(String name,
Object value)
Adds a name=value pair to the query string. |
LinkTool |
addQueryString(String name,
String value)
Adds a name=value pair to the query string. |
boolean |
checkPermission()
Checks execute permission for the linked URL. |
LinkTool |
clear()
Clears all current links. |
LinkTool |
clearBookmark()
Clears the bookmark. |
LinkTool |
clearPathInfo()
Clears the path info. |
LinkTool |
clearQueryString()
Clears the query string. |
Object |
clone()
|
void |
dispose()
Disposes the object by setting its disposed flag. |
protected String |
encodePathInfo()
Encodes the path info. |
protected String |
encodeQueryString()
Encodes the query string. |
boolean |
exists()
Checks whether the linked URL exists. |
String |
getBookmark()
Gets the linked bookmark. |
protected Filter |
getFilter(Class clazz)
Gets the first specific filter from the filter chain. |
protected String |
getFilterKey(Class clazz,
String cached)
Gets the key of the first specific key filter from the filter chain. |
String |
getHost()
Gets the linked host. |
protected HostFilter |
getHostFilter()
Gets the host filter from the filter stack. |
String |
getLink()
Gets the linked link. |
String |
getLinkAnchor(String link)
Gets the anchor of the specified link. |
Map |
getLinkAnchors()
Gets a map of link anchors for the current principal. |
Map |
getLinkAnchors(boolean all)
Gets a map of all link anchors. |
String |
getLinkBranch()
Gets the branch key of link of the current request. |
protected String |
getLinked(String key)
Gets the linked value. |
protected LinkFilter |
getLinkFilter()
Gets the link filter from the filter stack. |
String |
getLocale()
Gets the linked locale. |
String |
getPathInfo()
Gets the last component of the path info as a string. |
String |
getPipe()
Gets the linked pipe. |
String |
getPipeAnchor(String pipe)
Gets the anchor of the specified pipe. |
Map |
getPipeAnchors()
Gets a map of pipe anchors for the current principal. |
Map |
getPipeAnchors(boolean all)
Gets a map of all pipe anchors. |
String |
getPipeBranch()
Gets the branch key of pipe of the current request. |
protected PipeFilter |
getPipeFilter()
Gets the pipe filter from the filter stack. |
int |
getPort()
Gets the linked port. |
String |
getScheme()
Gets the linked scheme. |
String |
getScriptName()
Gets the linked script name (context path + servlet path). |
String |
getService()
Gets the linked service. |
String |
getServiceAnchor(String service)
Gets the anchor of the specified service. |
Map |
getServiceAnchors()
Gets a map of service anchors for the current principal. |
Map |
getServiceAnchors(boolean all)
Gets a map of all service anchors. |
String |
getServiceBranch()
Gets the branch key of service of the current request. |
protected ServiceFilter |
getServiceFilter()
Gets the service filter from the filter stack. |
String |
getServletPath()
Gets the linked servlet path. |
String |
getSource()
Gets the linked cached source. |
String |
getTempSource()
Gets the linked temporary source. |
String |
getUpload()
Gets the linked upload field. |
String |
getURL()
Gets the URL as a string. |
boolean |
isAbsolute()
Checks whether this link is absolute. |
protected boolean |
isPathInfoParsed()
Checks the parse path info option. |
boolean |
isRedirected()
Checks whether this link is a redirection. |
boolean |
isSecure()
Checks whether this link is secure. |
protected void |
linkModified()
A callback informing subclasses about a modified link. |
MediaTool |
removeHost()
Removes the linked host. |
LinkTool |
removeLink()
Removes the linked link. |
protected LinkTool |
removeLinked(String key)
Removes the linked value. |
LinkTool |
removePathInfo(String name)
Removes a name=value pair from the path info. |
LinkTool |
removePipe()
Removes the linked pipe. |
LinkTool |
removeQueryString(String name)
Removes a name=value pair from the query string. |
LinkTool |
removeService()
Removes the linked service. |
LinkTool |
reset()
Resets the default URL. |
MediaTool |
resetHost()
Resets the default host. |
LinkTool |
resetLink()
Resets the default link. |
LinkTool |
resetPipe()
Resets the default pipe. |
LinkTool |
resetService()
Resets the default service. |
LinkTool |
setAbsolute(boolean flag)
Sets this link to be either absolute or relative. |
LinkTool |
setBookmark(String bm)
Sets the linked bookmark. |
MediaTool |
setHost(String host)
Sets the linked host. |
LinkTool |
setLink(String link)
Sets the linked link. |
protected LinkTool |
setLinked(String key,
String value)
Sets the linked value. |
LinkTool |
setLocale(String locale)
Sets the linked locale. |
LinkTool |
setPathInfo(String info)
Sets the last component of the path info as a string. |
LinkTool |
setPathInfo(String info,
boolean always)
Sets the last component of the path info as a string optionally only if the path info is not parsed. |
LinkTool |
setPipe(String pipe)
Sets the linked pipe. |
LinkTool |
setPort(int port)
Sets the linked port. |
LinkTool |
setRedirected(boolean flag)
Sets this link to be a redirection. |
LinkTool |
setScheme(String scheme)
Sets the linked scheme. |
LinkTool |
setScriptName(String name)
Sets the linked script name (context path + servlet path). |
LinkTool |
setSecure(boolean flag)
Sets this link to be either secure or non-secure. |
LinkTool |
setSecure(boolean flag,
int port)
Sets this link to be either secure or non-secure and to use a given port. |
LinkTool |
setService(String service)
Sets the linked service. |
LinkTool |
setServletPath(String path)
Sets the linked servlet path. |
LinkTool |
setSource(String source)
Sets the linked source. |
LinkTool |
setSource(String source,
boolean localized)
Sets the linked localized source. |
LinkTool |
setTempSource(String source)
Sets the linked temporary source. |
LinkTool |
setTempSource(String source,
boolean localized)
Sets the linked localized temporary source. |
LinkTool |
setUpload(String field)
Sets the linked upload field for file uploads. |
LinkTool |
setURL(String url)
Sets the URL as a string. |
String |
toString()
Returns the URL as a string and clears the link to its initial state. |
| Methods inherited from class org.norther.tammi.spray.media.tool.MediaTool |
|---|
clearContentKey, toURL, toURL |
| Methods inherited from class org.norther.tammi.spray.engine.tool.ContextTool |
|---|
getFilterChain, getFilterKey, getPrincipal, getRequest, getResponse, isFilterChanged |
| Methods inherited from class org.norther.tammi.spray.engine.tool.GlobalTool |
|---|
getContext, getContextToolFilter, getMBeanServer, getName, isBound, nop, valueBound, valueUnbound |
| Methods inherited from class org.norther.tammi.core.pool.PoolableSupport |
|---|
disposed, recycled |
| Methods inherited from class org.norther.tammi.core.pool.RecyclableSupport |
|---|
isDisposed, recycle |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.core.pool.Recyclable |
|---|
isDisposed, recycle |
| Constructor Detail |
|---|
public LinkTool()
| Method Detail |
|---|
public Object clone()
clone in class MediaToolpublic void dispose()
RecyclableSupport
dispose in interface Recyclabledispose in class MediaToolpublic String getScheme()
public LinkTool setScheme(String scheme)
scheme - the scheme.
public int getPort()
public LinkTool setPort(int port)
port - the port.
public String getScriptName()
Note that the context path of the link URL can't be get or set alone but only as part of the script name.
public LinkTool setScriptName(String name)
Note that setting the servlet path has no effect after the script name has been set.
name - the script name.
public String getServletPath()
public LinkTool setServletPath(String path)
Note that setting the servlet path has no effect if the script name has already been set.
path - the servlet path.
public boolean isSecure()
public LinkTool setSecure(boolean flag)
flag - true for a secure link, false otherwise.
public LinkTool setSecure(boolean flag,
int port)
flag - true for a secure link, false otherwise.port - the server port.
public boolean isAbsolute()
public LinkTool setAbsolute(boolean flag)
Note that setting the flag to false does not supersede the
AbsoluteURLLinks configuration option.
flag - the absolute flag.
public boolean isRedirected()
public LinkTool setRedirected(boolean flag)
HttpServletRequest.encodeRedirectURL
method.
flag - the redirected flag.
public String getBookmark()
public LinkTool setBookmark(String bm)
bm - the bookmark.
public LinkTool clearBookmark()
public String getPathInfo()
public LinkTool setPathInfo(String info)
info - the path info.
public LinkTool setPathInfo(String info,
boolean always)
info - the path info.always - the always option.
public LinkTool addPathInfo(List list)
list - the list.
public LinkTool addPathInfo(String name,
Object value)
name - the name.value - the value.
public LinkTool addPathInfo(String name,
String value)
name - the name.value - the value.
NullPointerException - for a null name.
IllegalArgumentException - for a name with slashes.
public LinkTool addPathInfo(String name,
double value)
name - the name.value - the value.
public LinkTool addPathInfo(String name,
int value)
name - the name.value - the value.
public LinkTool addPathInfo(String name,
long value)
name - the name.value - the value.
public LinkTool removePathInfo(String name)
Note that possible dependencies are not updated, call dedicated remove methods when applicable.
name - the name to be removed.
public LinkTool clearPathInfo()
public LinkTool addQueryString(List list)
list - the list.
public LinkTool addQueryString(String name)
name - the name.
public LinkTool addQueryString(String name,
Object value)
name - the name.value - the value.
public LinkTool addQueryString(String name,
String value)
name - the name.value - the value.
NullPointerException - for a null name.
public LinkTool addQueryString(String name,
double value)
name - the name.value - the value.
public LinkTool addQueryString(String name,
int value)
name - the name.value - the value.
public LinkTool addQueryString(String name,
long value)
name - the name.value - the value.
public LinkTool removeQueryString(String name)
Note that possible dependencies are not updated, call dedicated remove methods when applicable.
name - the name to be removed.
public LinkTool clearQueryString()
public String getHost()
public MediaTool resetHost()
public MediaTool setHost(String host)
host - the host.
public MediaTool removeHost()
public LinkTool resetService()
public String getService()
public LinkTool setService(String service)
service - the service.
NullPointerException - if not settable.public LinkTool removeService()
public String getServiceBranch()
public String getServiceAnchor(String service)
service - the service.
public Map getServiceAnchors()
public Map getServiceAnchors(boolean all)
all - true for all links, false for authorized links.
public LinkTool resetPipe()
public String getPipe()
public LinkTool setPipe(String pipe)
pipe - the pipe.
NullPointerException - if not settable.public LinkTool removePipe()
public String getPipeBranch()
public String getPipeAnchor(String pipe)
pipe - the pipe.
public Map getPipeAnchors()
public Map getPipeAnchors(boolean all)
all - true for all links, false for authorized links.
public LinkTool resetLink()
public String getLink()
public LinkTool setLink(String link)
link - the link.
NullPointerException - if not settable.public LinkTool removeLink()
public String getLinkBranch()
public String getLinkAnchor(String link)
link - the link.
public Map getLinkAnchors()
public Map getLinkAnchors(boolean all)
all - true for all links, false for authorized links.
public String getLocale()
public LinkTool setLocale(String locale)
locale - the locale.
public LinkTool setSource(String source)
source - the source.
public LinkTool setSource(String source,
boolean localized)
Note that search for localized sources is available only if the content filter is configured to support localized content.
source - the source.localized - true for a localized source.
public String getTempSource()
public LinkTool setTempSource(String source)
source - the source.
public LinkTool setTempSource(String source,
boolean localized)
Note that search for localized sources is available only if the content filter is configured to support localized content.
source - the source.localized - true for a localized source.
public String getSource()
public String getUpload()
public LinkTool setUpload(String field)
field - the upload value specifying the file name field on the
upload form, an empty field indicates that no such field exists.
public String getURL()
Note that the link is not XML encoded but the caller is responsible for pre- or post-processing the link for the target environment.
public LinkTool reset()
public LinkTool setURL(String url)
Note that the link may be a full or partial URL and the scheme, host, port and script name of the current link URL are updated accordingly. The path info and query string are cleared before setting the URL.
url - the link URL.
public String toString()
Note that the link is not XML encoded but the caller is responsible for pre- or post-processing the link for the target environment.
toString in class GlobalToolpublic LinkTool clear()
public boolean exists()
public boolean checkPermission()
protected void linkModified()
protected String getLinked(String key)
key - the linked key.
protected LinkTool setLinked(String key,
String value)
key - the linked key.value - the linked value.
protected LinkTool removeLinked(String key)
key - the linked key.
protected String encodePathInfo()
protected String encodeQueryString()
protected boolean isPathInfoParsed()
protected String getFilterKey(Class clazz,
String cached)
clazz - the class or interface of the key filter.cached - the cached key if any.
protected HostFilter getHostFilter()
protected ServiceFilter getServiceFilter()
getServiceFilter in class MediaToolprotected PipeFilter getPipeFilter()
protected LinkFilter getLinkFilter()
protected Filter getFilter(Class clazz)
ContextTool
getFilter in class ContextToolclazz - the class or interface of the filter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||