Java Doc for URLTemplate.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » core » urltemplates » 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 » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.core.urltemplates 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.beehive.netui.core.urltemplates.URLTemplate

URLTemplate
public class URLTemplate implements Serializable(Code)
The class to format a URL defined by url-template-config template given by values for a set of tokens.

Inner Class :protected class TemplateItem implements Serializable


Constructor Summary
public  URLTemplate(String template)
     Create a URLTemplate from a url-template-config template.
public  URLTemplate(String template, String name)
     Create a URLTemplate from a url-template-config template.
public  URLTemplate(URLTemplate template)
     Copy constructor to create a URLTemplate from an existing URLTemplate.

Note that this is not truly a complete copy because the Map of the replacement values for the given tokens is not copied. This copy will just have an empty map of token values so that it is "cleared" and ready to format another URL.


Method Summary
protected  voidappendToResult(InternalStringBuilder result, String value)
    
public  Stringformat()
     Return the String representation of the URL after replacing the tokens in the template with their associated values.
public  Stringformat(boolean removeUnsetTokens)
     Return the String representation of the URL after replacing the tokens in the template with their associated values. If the boolean argument is true, then the unset template tokens are removed.
public  StringgetName()
    
public  StringgetTemplate()
     Retrieve the String form of the template.
public  voidsetName(String name)
    
public  voidsetTemplate(String template)
     Reset the String form of the template.

Should call verify after setting a new template.

public  voidsubstitute(Map tokensAndValues)
     Replace a set of tokens in the template with a corresponding set of values. This assumes that there is an ordered one-to-one relationship.
public  voidsubstitute(String token, String value)
     Replace a single token in the template with a corresponding String value. Tokens are expected to be qualified in braces.
public  voidsubstitute(String token, int value)
     Replace a single token in the template with a corresponding int value. Tokens are expected to be qualified in braces.
public  StringtoString()
     Return the String representation of the URL after replacing the tokens in the template with their associated values.
public  booleanverify(Collection knownTokens, Collection requiredTokens)
     Verification will ensure the URL template conforms to a valid format for known tokens and contains the required tokens.


Constructor Detail
URLTemplate
public URLTemplate(String template)(Code)
Create a URLTemplate from a url-template-config template.
Parameters:
  template - the string form of the template from url-template-config.



URLTemplate
public URLTemplate(String template, String name)(Code)
Create a URLTemplate from a url-template-config template.
Parameters:
  template - the string form of the template from url-template-config.
Parameters:
  name - the name of the template



URLTemplate
public URLTemplate(URLTemplate template)(Code)
Copy constructor to create a URLTemplate from an existing URLTemplate.

Note that this is not truly a complete copy because the Map of the replacement values for the given tokens is not copied. This copy will just have an empty map of token values so that it is "cleared" and ready to format another URL.


Parameters:
  template - the URLTemplate to copy.




Method Detail
appendToResult
protected void appendToResult(InternalStringBuilder result, String value)(Code)



format
public String format()(Code)
Return the String representation of the URL after replacing the tokens in the template with their associated values. If there is no value for a token, the token is discarded/removed. I.E. It will not be part of the returned String. the url



format
public String format(boolean removeUnsetTokens)(Code)
Return the String representation of the URL after replacing the tokens in the template with their associated values. If the boolean argument is true, then the unset template tokens are removed. Otherwise, do not cleanup the unset tokens.
Parameters:
  removeUnsetTokens - flag to tell URLTemplate to removeor leave the unset tokens in the URL. the url



getName
public String getName()(Code)



getTemplate
public String getTemplate()(Code)
Retrieve the String form of the template. the string form of the template.



setName
public void setName(String name)(Code)



setTemplate
public void setTemplate(String template)(Code)
Reset the String form of the template.

Should call verify after setting a new template.


Parameters:
  template - the string form of the template from url-template-config.



substitute
public void substitute(Map tokensAndValues)(Code)
Replace a set of tokens in the template with a corresponding set of values. This assumes that there is an ordered one-to-one relationship. Tokens are expected to be qualified in braces. E.g. {url:path}



substitute
public void substitute(String token, String value)(Code)
Replace a single token in the template with a corresponding String value. Tokens are expected to be qualified in braces. E.g. {url:path}



substitute
public void substitute(String token, int value)(Code)
Replace a single token in the template with a corresponding int value. Tokens are expected to be qualified in braces. E.g. {url:port}



toString
public String toString()(Code)
Return the String representation of the URL after replacing the tokens in the template with their associated values. If there is no value for a token, the token is discarded/removed. I.E. It will not be part of the returned String. the url



verify
public boolean verify(Collection knownTokens, Collection requiredTokens)(Code)
Verification will ensure the URL template conforms to a valid format for known tokens and contains the required tokens. It will also parse the tokens and literal data into a list to improve the replacement performance when constructing the final URL string.

Allow clients to define a set of required and known tokens for the template verification. Tokens are expected to be qualified in braces. E.g. {url:path}

If the template does not contain the required tokens or if the format of a known token is incorrect, this method will log the error and return false.

Should call verify after creating a new template.


Parameters:
  knownTokens - the collection of known tokens (Strings) for a valid template.
Parameters:
  requiredTokens - the collection of required tokens (Strings) in a valid template. true if the template conforms to a valid format, otherwise return false.



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.