|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.turbine.util.uri.BaseURI
org.apache.turbine.util.uri.TurbineURI
public class TurbineURI
This class allows you to keep all the information needed for a single link at one place. It keeps your query data, path info, the server scheme, name, port and the script path. If you must generate a Turbine Link, use this class.
| Field Summary |
|---|
| Fields inherited from interface org.apache.turbine.util.uri.URIConstants |
|---|
CGI_ACTION_PARAM, CGI_SCREEN_PARAM, CGI_TEMPLATE_PARAM, EVENT_PREFIX, FTP_PORT, HTTP, HTTP_PORT, HTTPS, HTTPS_PORT, PATH_INFO, QUERY_DATA, URI_SCHEME_SEPARATOR |
| Constructor Summary | |
|---|---|
TurbineURI()
Empty C'tor. |
|
TurbineURI(RunData runData)
Constructor with a RunData object. |
|
TurbineURI(RunData runData,
boolean redirect)
Constructor, set explicit redirection. |
|
TurbineURI(RunData runData,
String screen)
Constructor, set Screen. |
|
TurbineURI(RunData runData,
String screen,
boolean redirect)
Constructor, set Screen, set explicit redirection. |
|
TurbineURI(RunData runData,
String screen,
String action)
Constructor, set Screen and Action. |
|
TurbineURI(RunData runData,
String screen,
String action,
boolean redirect)
Constructor, set Screen and Action, set explicit redirection. |
|
TurbineURI(ServerData serverData)
Constructor with a ServerData object. |
|
TurbineURI(ServerData serverData,
boolean redirect)
Constructor, set explicit redirection. |
|
TurbineURI(ServerData serverData,
String screen)
Constructor, set Screen. |
|
TurbineURI(ServerData serverData,
String screen,
boolean redirect)
Constructor, set Screen, set explicit redirection. |
|
TurbineURI(ServerData serverData,
String screen,
String action)
Constructor, set Screen and Action. |
|
TurbineURI(ServerData serverData,
String screen,
String action,
boolean redirect)
Constructor, set Screen and Action, set explicit redirection. |
|
TurbineURI(String screen,
String action)
Constructor, user Turbine.getDefaultServerData(), set Screen and Action. |
|
| Method Summary | |
|---|---|
protected void |
add(int type,
List<URIParam> list)
Method for a quick way to add all the parameters in a List with URIParam objects. |
protected void |
add(int type,
org.apache.fulcrum.parser.ParameterParser pp)
Method for a quick way to add all the parameters in a ParameterParser. |
protected void |
add(int type,
String name,
String value)
If the type is PATH_INFO, then add name/value to the pathInfo hashtable. |
void |
addPathInfo(List<URIParam> list)
Adds an existing List of URIParam objects to the path_info string. |
void |
addPathInfo(org.apache.fulcrum.parser.ParameterParser pp)
Adds a name=value pair for every entry in a ParameterParser object to the path_info string. |
void |
addPathInfo(String name,
double value)
Adds a name=value pair to the path_info string. |
void |
addPathInfo(String name,
int value)
Adds a name=value pair to the path_info string. |
void |
addPathInfo(String name,
long value)
Adds a name=value pair to the path_info string. |
void |
addPathInfo(String name,
Object value)
Adds a name=value pair to the path_info string. |
void |
addPathInfo(String name,
String value)
Adds a name=value pair to the path_info string. |
void |
addQueryData(List<URIParam> list)
Adds an existing List of URIParam objects to the query data. |
void |
addQueryData(org.apache.fulcrum.parser.ParameterParser pp)
Adds a name=value pair for every entry in a ParameterParser object to the query string. |
void |
addQueryData(String name,
double value)
Adds a name=value pair to the query string. |
void |
addQueryData(String name,
int value)
Adds a name=value pair to the query string. |
void |
addQueryData(String name,
long value)
Adds a name=value pair to the query string. |
void |
addQueryData(String name,
Object value)
Adds a name=value pair to the query string. |
void |
addQueryData(String name,
String value)
Adds a name=value pair to the query string. |
void |
clearAction()
Clears the action= value for this URL. |
void |
clearResponse()
Template Link and friends want to be able to turn the encoding of the servlet container off. |
void |
clearScreen()
Clears the screen= value for this URL. |
String |
getAbsoluteLink()
Builds the URL with all of the data URL-encoded as well as encoded using HttpServletResponse.encodeUrl(). |
List<URIParam> |
getPathInfo()
Gets the current Query Data List. |
List<URIParam> |
getQueryData()
Gets the current Query Data List. |
String |
getRelativeLink()
Builds the URL with all of the data URL-encoded as well as encoded using HttpServletResponse.encodeUrl(). |
boolean |
hasPathInfo()
Is Path Info data set in this URI? |
boolean |
hasQueryData()
Is Query data set in this URI? |
protected void |
remove(int type,
String name)
If the type is P (0), then remove name/value from the pathInfo hashtable. |
void |
removePathInfo()
Removes all the path info elements. |
void |
removePathInfo(String name)
Removes a name=value pair from the path info. |
void |
removeQueryData()
Removes all the query string elements. |
void |
removeQueryData(String name)
Removes a name=value pair from the query string. |
void |
setAction(String action)
Sets the action= value for this URL. |
void |
setActionEvent(String action,
String event)
Sets the action= and eventSubmit= values for this URL. |
void |
setEvent(String event)
Sets the fired eventSubmit= value for this URL. |
void |
setPathInfo(List<URIParam> pathInfo)
Sets the Query Data List. |
void |
setQueryData(List<URIParam> queryData)
Sets the Query Data List. |
void |
setScreen(String screen)
Sets the screen= value for this URL. |
String |
toString()
Simply calls getAbsoluteLink(). |
| Methods inherited from class org.apache.turbine.util.uri.BaseURI |
|---|
encodeResponse, getContextAndScript, getContextPath, getReference, getResponse, getSchemeAndPort, getScriptName, getServerName, getServerPort, getServerScheme, hasReference, isRedirect, setContextPath, setRedirect, setReference, setResponse, setScriptName, setSecure, setSecure, setServerName, setServerPort, setServerScheme |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TurbineURI()
public TurbineURI(RunData runData)
runData - A RunData object
public TurbineURI(RunData runData,
boolean redirect)
runData - A RunData objectredirect - True if redirection allowed.
public TurbineURI(RunData runData,
String screen)
runData - A RunData objectscreen - A Screen Name
public TurbineURI(RunData runData,
String screen,
boolean redirect)
runData - A RunData objectscreen - A Screen Nameredirect - True if redirection allowed.
public TurbineURI(RunData runData,
String screen,
String action)
runData - A RunData objectscreen - A Screen Nameaction - An Action Name
public TurbineURI(RunData runData,
String screen,
String action,
boolean redirect)
runData - A RunData objectscreen - A Screen Nameaction - An Action Nameredirect - True if redirection allowed.public TurbineURI(ServerData serverData)
serverData - A ServerData object
public TurbineURI(ServerData serverData,
boolean redirect)
serverData - A ServerData objectredirect - True if redirection allowed.
public TurbineURI(ServerData serverData,
String screen)
serverData - A ServerData objectscreen - A Screen Name
public TurbineURI(ServerData serverData,
String screen,
boolean redirect)
serverData - A ServerData objectscreen - A Screen Nameredirect - True if redirection allowed.
public TurbineURI(ServerData serverData,
String screen,
String action)
serverData - A ServerData objectscreen - A Screen Nameaction - An Action Name
public TurbineURI(ServerData serverData,
String screen,
String action,
boolean redirect)
serverData - A ServerData objectscreen - A Screen Nameaction - An Action Nameredirect - True if redirection allowed.
public TurbineURI(String screen,
String action)
screen - A Screen Nameaction - An Action Name| Method Detail |
|---|
public void setAction(String action)
action - A String with the action value.public void setEvent(String event)
event - The event to fire.
public void setActionEvent(String action,
String event)
action - A String with the action value.event - A string with the event name.public void clearAction()
public void setScreen(String screen)
screen - A String with the screen value.public void clearScreen()
public void addPathInfo(org.apache.fulcrum.parser.ParameterParser pp)
pp - A ParameterParser.public void addPathInfo(List<URIParam> list)
list - A list with URIParam objects.
public void addPathInfo(String name,
Object value)
name - A String with the name to add.value - An Object with the value to add.
public void addPathInfo(String name,
String value)
name - A String with the name to add.value - A String with the value to add.
public void addPathInfo(String name,
double value)
name - A String with the name to add.value - A double with the value to add.
public void addPathInfo(String name,
int value)
name - A String with the name to add.value - An int with the value to add.
public void addPathInfo(String name,
long value)
name - A String with the name to add.value - A long with the value to add.
public void addQueryData(String name,
Object value)
name - A String with the name to add.value - An Object with the value to add.
public void addQueryData(String name,
String value)
name - A String with the name to add.value - A String with the value to add.
public void addQueryData(String name,
double value)
name - A String with the name to add.value - A double with the value to add.
public void addQueryData(String name,
int value)
name - A String with the name to add.value - An int with the value to add.
public void addQueryData(String name,
long value)
name - A String with the name to add.value - A long with the value to add.public void addQueryData(org.apache.fulcrum.parser.ParameterParser pp)
pp - A ParameterParser.public void addQueryData(List<URIParam> list)
list - A list with URIParam objects.public boolean hasPathInfo()
public void removePathInfo()
public void removePathInfo(String name)
name - A String with the name to be removed.public boolean hasQueryData()
public void removeQueryData()
public void removeQueryData(String name)
name - A String with the name to be removed.public void clearResponse()
public String getAbsoluteLink()
The above call to absoluteLink() would return the String:
TurbineURI tui = new TurbineURI (data, "UserScreen");
tui.addPathInfo("user","jon");
tui.getAbsoluteLink();
http://www.server.com/servlets/Turbine/screen/UserScreen/user/jon
public String getRelativeLink()
The above call to relativeLink() would return the String:
TurbineURI tui = new TurbineURI (data, "UserScreen");
tui.addPathInfo("user","jon");
tui.getRelativeLink();
/servlets/Turbine/screen/UserScreen/user/jon
public List<URIParam> getPathInfo()
public void setPathInfo(List<URIParam> pathInfo)
pathInfo - A List with new param objects.public List<URIParam> getQueryData()
public void setQueryData(List<URIParam> queryData)
queryData - A List with new param objects.public String toString()
toString in class Object
protected void add(int type,
String name,
String value)
If the type is QUERY_DATA, then add name/value to the queryData hashtable.
type - Type (PATH_INFO or QUERY_DATA) of insertion.name - A String with the name to add.value - A String with the value to add.
protected void add(int type,
org.apache.fulcrum.parser.ParameterParser pp)
If the type is P (0), then add name/value to the pathInfo hashtable.
If the type is Q (1), then add name/value to the queryData hashtable.
type - Type of insertion (@see #add(char type, String name, String value))pp - A ParameterParser.
protected void add(int type,
List<URIParam> list)
If the type is P (0), then add name/value to the pathInfo hashtable.
If the type is Q (1), then add name/value to the queryData hashtable.
type - Type of insertion (@see #add(char type, String name, String value))list - A List of URIParam objects
protected void remove(int type,
String name)
If the type is Q (1), then remove name/value from the queryData hashtable.
type - Type (P or Q) of removal.name - A String with the name to be removed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||