Java Doc for TurbineURI.java in  » Web-Framework » TURBINE » org » apache » turbine » util » uri » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » TURBINE » org.apache.turbine.util.uri 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.turbine.util.uri.BaseURI
      org.apache.turbine.util.uri.TurbineURI

All known Subclasses:   org.apache.turbine.util.uri.TemplateURI,
TurbineURI
public class TurbineURI extends BaseURI (Code)
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.
author:
   Jon S. Stevens
author:
   Jason van Zyl
author:
   Henning P. Schmiedehausen
version:
   $Id: TurbineURI.java 638205 2008-03-18 04:10:39Z seade $



Constructor Summary
public  TurbineURI()
     Empty C'tor.
public  TurbineURI(RunData runData)
     Constructor with a RunData object.
public  TurbineURI(RunData runData, boolean redirect)
     Constructor, set explicit redirection.
public  TurbineURI(RunData runData, String screen)
     Constructor, set Screen.
public  TurbineURI(RunData runData, String screen, boolean redirect)
     Constructor, set Screen, set explicit redirection.
public  TurbineURI(RunData runData, String screen, String action)
     Constructor, set Screen and Action.
public  TurbineURI(RunData runData, String screen, String action, boolean redirect)
     Constructor, set Screen and Action, set explicit redirection.
public  TurbineURI(ServerData serverData)
     Constructor with a ServerData object.
public  TurbineURI(ServerData serverData, boolean redirect)
     Constructor, set explicit redirection.
public  TurbineURI(ServerData serverData, String screen)
     Constructor, set Screen.
public  TurbineURI(ServerData serverData, String screen, boolean redirect)
     Constructor, set Screen, set explicit redirection.
public  TurbineURI(ServerData serverData, String screen, String action)
     Constructor, set Screen and Action.
public  TurbineURI(ServerData serverData, String screen, String action, boolean redirect)
     Constructor, set Screen and Action, set explicit redirection.
public  TurbineURI(String screen, String action)
     Constructor, user Turbine.getDefaultServerData(), set Screen and Action.

Method Summary
protected  voidadd(int type, String name, String value)
     If the type is PATH_INFO, then add name/value to the pathInfo hashtable.
protected  voidadd(int type, ParameterParser pp)
     Method for a quick way to add all the parameters in a ParameterParser.
protected  voidadd(int type, List list)
     Method for a quick way to add all the parameters in a List with URIParam objects.
public  voidaddPathInfo(ParameterParser pp)
     Adds a name=value pair for every entry in a ParameterParser object to the path_info string.
public  voidaddPathInfo(List list)
     Adds an existing List of URIParam objects to the path_info string.
public  voidaddPathInfo(String name, Object value)
     Adds a name=value pair to the path_info string.
public  voidaddPathInfo(String name, String value)
     Adds a name=value pair to the path_info string.
public  voidaddPathInfo(String name, double value)
     Adds a name=value pair to the path_info string.
public  voidaddPathInfo(String name, int value)
     Adds a name=value pair to the path_info string.
public  voidaddPathInfo(String name, long value)
     Adds a name=value pair to the path_info string.
public  voidaddQueryData(String name, Object value)
     Adds a name=value pair to the query string.
public  voidaddQueryData(String name, String value)
     Adds a name=value pair to the query string.
public  voidaddQueryData(String name, double value)
     Adds a name=value pair to the query string.
public  voidaddQueryData(String name, int value)
     Adds a name=value pair to the query string.
public  voidaddQueryData(String name, long value)
     Adds a name=value pair to the query string.
public  voidaddQueryData(ParameterParser pp)
     Adds a name=value pair for every entry in a ParameterParser object to the query string.
public  voidaddQueryData(List list)
     Adds an existing List of URIParam objects to the query data.
public  voidclearAction()
     Clears the action= value for this URL.
public  voidclearResponse()
     Template Link and friends want to be able to turn the encoding of the servlet container off.
public  voidclearScreen()
     Clears the screen= value for this URL.
public  StringgetAbsoluteLink()
     Builds the URL with all of the data URL-encoded as well as encoded using HttpServletResponse.encodeUrl().
public  ListgetPathInfo()
     Gets the current Query Data List. A List which contains all query data keys.
public  ListgetQueryData()
     Gets the current Query Data List. A List which contains all query data keys.
public  StringgetRelativeLink()
     Builds the URL with all of the data URL-encoded as well as encoded using HttpServletResponse.encodeUrl().
public  booleanhasPathInfo()
    
public  booleanhasQueryData()
    
protected  voidremove(int type, String name)
     If the type is P (0), then remove name/value from the pathInfo hashtable.
public  voidremovePathInfo()
     Removes all the path info elements.
public  voidremovePathInfo(String name)
     Removes a name=value pair from the path info.
public  voidremoveQueryData()
     Removes all the query string elements.
public  voidremoveQueryData(String name)
     Removes a name=value pair from the query string.
public  voidsetAction(String action)
     Sets the action= value for this URL. By default it adds the information to the path_info instead of the query data.
public  voidsetActionEvent(String action, String event)
     Sets the action= and eventSubmit= values for this URL. By default it adds the information to the path_info instead of the query data.
public  voidsetEvent(String event)
     Sets the fired eventSubmit= value for this URL.
public  voidsetPathInfo(List pathInfo)
     Sets the Query Data List.
public  voidsetQueryData(List queryData)
     Sets the Query Data List.
public  voidsetScreen(String screen)
     Sets the screen= value for this URL. By default it adds the information to the path_info instead of the query data.
public  StringtoString()
     Simply calls getAbsoluteLink().


Constructor Detail
TurbineURI
public TurbineURI()(Code)
Empty C'tor. Uses Turbine.getDefaultServerData().



TurbineURI
public TurbineURI(RunData runData)(Code)
Constructor with a RunData object.
Parameters:
  runData - A RunData object



TurbineURI
public TurbineURI(RunData runData, boolean redirect)(Code)
Constructor, set explicit redirection.
Parameters:
  runData - A RunData object
Parameters:
  redirect - True if redirection allowed.



TurbineURI
public TurbineURI(RunData runData, String screen)(Code)
Constructor, set Screen.
Parameters:
  runData - A RunData object
Parameters:
  screen - A Screen Name



TurbineURI
public TurbineURI(RunData runData, String screen, boolean redirect)(Code)
Constructor, set Screen, set explicit redirection.
Parameters:
  runData - A RunData object
Parameters:
  screen - A Screen Name
Parameters:
  redirect - True if redirection allowed.



TurbineURI
public TurbineURI(RunData runData, String screen, String action)(Code)
Constructor, set Screen and Action.
Parameters:
  runData - A RunData object
Parameters:
  screen - A Screen Name
Parameters:
  action - An Action Name



TurbineURI
public TurbineURI(RunData runData, String screen, String action, boolean redirect)(Code)
Constructor, set Screen and Action, set explicit redirection.
Parameters:
  runData - A RunData object
Parameters:
  screen - A Screen Name
Parameters:
  action - An Action Name
Parameters:
  redirect - True if redirection allowed.



TurbineURI
public TurbineURI(ServerData serverData)(Code)
Constructor with a ServerData object.
Parameters:
  serverData - A ServerData object



TurbineURI
public TurbineURI(ServerData serverData, boolean redirect)(Code)
Constructor, set explicit redirection.
Parameters:
  serverData - A ServerData object
Parameters:
  redirect - True if redirection allowed.



TurbineURI
public TurbineURI(ServerData serverData, String screen)(Code)
Constructor, set Screen.
Parameters:
  serverData - A ServerData object
Parameters:
  screen - A Screen Name



TurbineURI
public TurbineURI(ServerData serverData, String screen, boolean redirect)(Code)
Constructor, set Screen, set explicit redirection.
Parameters:
  serverData - A ServerData object
Parameters:
  screen - A Screen Name
Parameters:
  redirect - True if redirection allowed.



TurbineURI
public TurbineURI(ServerData serverData, String screen, String action)(Code)
Constructor, set Screen and Action.
Parameters:
  serverData - A ServerData object
Parameters:
  screen - A Screen Name
Parameters:
  action - An Action Name



TurbineURI
public TurbineURI(ServerData serverData, String screen, String action, boolean redirect)(Code)
Constructor, set Screen and Action, set explicit redirection.
Parameters:
  serverData - A ServerData object
Parameters:
  screen - A Screen Name
Parameters:
  action - An Action Name
Parameters:
  redirect - True if redirection allowed.



TurbineURI
public TurbineURI(String screen, String action)(Code)
Constructor, user Turbine.getDefaultServerData(), set Screen and Action.
Parameters:
  screen - A Screen Name
Parameters:
  action - An Action Name




Method Detail
add
protected void add(int type, String name, String value)(Code)
If the type is PATH_INFO, then add name/value to the pathInfo hashtable.

If the type is QUERY_DATA, then add name/value to the queryData hashtable.
Parameters:
  type - Type (PATH_INFO or QUERY_DATA) of insertion.
Parameters:
  name - A String with the name to add.
Parameters:
  value - A String with the value to add.




add
protected void add(int type, ParameterParser pp)(Code)
Method for a quick way to add all the parameters in a ParameterParser.

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.
Parameters:
  type - Type of insertion (@see #add(char type, String name, String value))
Parameters:
  pp - A ParameterParser.




add
protected void add(int type, List list)(Code)
Method for a quick way to add all the parameters in a List with URIParam objects.

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.
Parameters:
  type - Type of insertion (@see #add(char type, String name, String value))
Parameters:
  list - A List of URIParam objects




addPathInfo
public void addPathInfo(ParameterParser pp)(Code)
Adds a name=value pair for every entry in a ParameterParser object to the path_info string.
Parameters:
  pp - A ParameterParser.



addPathInfo
public void addPathInfo(List list)(Code)
Adds an existing List of URIParam objects to the path_info string.
Parameters:
  list - A list with URIParam objects.



addPathInfo
public void addPathInfo(String name, Object value)(Code)
Adds a name=value pair to the path_info string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - An Object with the value to add.



addPathInfo
public void addPathInfo(String name, String value)(Code)
Adds a name=value pair to the path_info string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - A String with the value to add.



addPathInfo
public void addPathInfo(String name, double value)(Code)
Adds a name=value pair to the path_info string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - A double with the value to add.



addPathInfo
public void addPathInfo(String name, int value)(Code)
Adds a name=value pair to the path_info string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - An int with the value to add.



addPathInfo
public void addPathInfo(String name, long value)(Code)
Adds a name=value pair to the path_info string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - A long with the value to add.



addQueryData
public void addQueryData(String name, Object value)(Code)
Adds a name=value pair to the query string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - An Object with the value to add.



addQueryData
public void addQueryData(String name, String value)(Code)
Adds a name=value pair to the query string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - A String with the value to add.



addQueryData
public void addQueryData(String name, double value)(Code)
Adds a name=value pair to the query string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - A double with the value to add.



addQueryData
public void addQueryData(String name, int value)(Code)
Adds a name=value pair to the query string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - An int with the value to add.



addQueryData
public void addQueryData(String name, long value)(Code)
Adds a name=value pair to the query string.
Parameters:
  name - A String with the name to add.
Parameters:
  value - A long with the value to add.



addQueryData
public void addQueryData(ParameterParser pp)(Code)
Adds a name=value pair for every entry in a ParameterParser object to the query string.
Parameters:
  pp - A ParameterParser.



addQueryData
public void addQueryData(List list)(Code)
Adds an existing List of URIParam objects to the query data.
Parameters:
  list - A list with URIParam objects.



clearAction
public void clearAction()(Code)
Clears the action= value for this URL.



clearResponse
public void clearResponse()(Code)
Template Link and friends want to be able to turn the encoding of the servlet container off. After calling this method, the no encoding will happen any longer. If you think, that you need this outside a template context, think again.



clearScreen
public void clearScreen()(Code)
Clears the screen= value for this URL.



getAbsoluteLink
public String getAbsoluteLink()(Code)
Builds the URL with all of the data URL-encoded as well as encoded using HttpServletResponse.encodeUrl(). The resulting URL is absolute; it starts with http/https...

 TurbineURI tui = new TurbineURI (data, "UserScreen");
 tui.addPathInfo("user","jon");
 tui.getAbsoluteLink();
 
The above call to absoluteLink() would return the String:

http://www.server.com/servlets/Turbine/screen/UserScreen/user/jon A String with the built URL.




getPathInfo
public List getPathInfo()(Code)
Gets the current Query Data List. A List which contains all query data keys. The keysare URIParam objects.



getQueryData
public List getQueryData()(Code)
Gets the current Query Data List. A List which contains all query data keys. The keysare URIParam objects.



getRelativeLink
public String getRelativeLink()(Code)
Builds the URL with all of the data URL-encoded as well as encoded using HttpServletResponse.encodeUrl(). The resulting URL is relative to the webserver root.

 TurbineURI tui = new TurbineURI (data, "UserScreen");
 tui.addPathInfo("user","jon");
 tui.getRelativeLink();
 
The above call to relativeLink() would return the String:

/servlets/Turbine/screen/UserScreen/user/jon A String with the built URL.




hasPathInfo
public boolean hasPathInfo()(Code)
Is Path Info data set in this URI? true if Path Info has values



hasQueryData
public boolean hasQueryData()(Code)
Is Query data set in this URI? true if Query data has values



remove
protected void remove(int type, String name)(Code)
If the type is P (0), then remove name/value from the pathInfo hashtable.

If the type is Q (1), then remove name/value from the queryData hashtable.
Parameters:
  type - Type (P or Q) of removal.
Parameters:
  name - A String with the name to be removed.




removePathInfo
public void removePathInfo()(Code)
Removes all the path info elements.



removePathInfo
public void removePathInfo(String name)(Code)
Removes a name=value pair from the path info.
Parameters:
  name - A String with the name to be removed.



removeQueryData
public void removeQueryData()(Code)
Removes all the query string elements.



removeQueryData
public void removeQueryData(String name)(Code)
Removes a name=value pair from the query string.
Parameters:
  name - A String with the name to be removed.



setAction
public void setAction(String action)(Code)
Sets the action= value for this URL. By default it adds the information to the path_info instead of the query data. An empty value (null or "") cleans out an existing value.
Parameters:
  action - A String with the action value.



setActionEvent
public void setActionEvent(String action, String event)(Code)
Sets the action= and eventSubmit= values for this URL. By default it adds the information to the path_info instead of the query data. An empty value (null or "") for the action cleans out an existing value. An empty value (null or "") for the event has no effect.
Parameters:
  action - A String with the action value.
Parameters:
  event - A string with the event name.



setEvent
public void setEvent(String event)(Code)
Sets the fired eventSubmit= value for this URL.
Parameters:
  event - The event to fire.



setPathInfo
public void setPathInfo(List pathInfo)(Code)
Sets the Query Data List. Replaces the current query data list with the one supplied. The list must contain only URIParam objects!
Parameters:
  pathInfo - A List with new param objects.



setQueryData
public void setQueryData(List queryData)(Code)
Sets the Query Data List. Replaces the current query data list with the one supplied. The list must contain only URIParam objects!
Parameters:
  queryData - A List with new param objects.



setScreen
public void setScreen(String screen)(Code)
Sets the screen= value for this URL. By default it adds the information to the path_info instead of the query data. An empty value (null or "") cleans out an existing value.
Parameters:
  screen - A String with the screen value.



toString
public String toString()(Code)
Simply calls getAbsoluteLink(). You should not use this in your code unless you have to. Use getAbsoluteLink. This URI as a String



Methods inherited from org.apache.turbine.util.uri.BaseURI
protected String encodeResponse(String uri)(Code)(Java Doc)
protected void getContextAndScript(StringBuffer sb)(Code)(Java Doc)
public String getContextPath()(Code)(Java Doc)
public String getReference()(Code)(Java Doc)
protected HttpServletResponse getResponse()(Code)(Java Doc)
protected void getSchemeAndPort(StringBuffer sb)(Code)(Java Doc)
public String getScriptName()(Code)(Java Doc)
public String getServerName()(Code)(Java Doc)
public int getServerPort()(Code)(Java Doc)
public String getServerScheme()(Code)(Java Doc)
public boolean hasReference()(Code)(Java Doc)
public boolean isRedirect()(Code)(Java Doc)
public void setContextPath(String contextPath)(Code)(Java Doc)
public void setRedirect(boolean redirect)(Code)(Java Doc)
public void setReference(String reference)(Code)(Java Doc)
protected void setResponse(HttpServletResponse response)(Code)(Java Doc)
public void setScriptName(String scriptName)(Code)(Java Doc)
public void setSecure()(Code)(Java Doc)
public void setSecure(int port)(Code)(Java Doc)
public void setServerName(String serverName)(Code)(Java Doc)
public void setServerPort(int serverPort)(Code)(Java Doc)
public void setServerScheme(String serverScheme)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.